basix_doc 0.1
mmx Namespace Reference

Classes

Typedefs

Enumerations

Functions

Variables


Typedef Documentation

typedef char* char_ptr

Definition at line 60 of file defaults.hpp.

typedef char* charp

Definition at line 127 of file port.hpp.

typedef const char* const_charp

Definition at line 128 of file port.hpp.

typedef unsigned int nat

Definition at line 49 of file fast_new.hpp.

typedef pow_op rpow_op

Definition at line 1254 of file operators.hpp.

typedef unsigned char uchar

Definition at line 50 of file fast_new.hpp.

typedef unsigned int uint

Definition at line 52 of file fast_new.hpp.

typedef unsigned long ulong

Definition at line 53 of file fast_new.hpp.

typedef generic(* unary_generic)(const generic &)

Definition at line 254 of file port.hpp.

typedef unsigned short ushort

Definition at line 51 of file fast_new.hpp.

typedef routine* vec_routine

Definition at line 477 of file generic.hpp.

typedef void* void_ptr

Definition at line 59 of file defaults.hpp.

typedef long int xint

Definition at line 59 of file fast_new.hpp.

typedef unsigned long int xnat

Definition at line 60 of file fast_new.hpp.


Enumeration Type Documentation

Enumerator:
MMX_ROUND_NEAR 
MMX_ROUND_ZERO 
MMX_ROUND_UP 
MMX_ROUND_DOWN 

Definition at line 826 of file type_props.hpp.

Enumerator:
LF 
INDENT 
UNINDENT 
LF 
INDENT 
VARINDENT 
UNINDENT 

Definition at line 85 of file mmx_printer.cpp.

Enumerator:
LF 
INDENT 
UNINDENT 
LF 
INDENT 
VARINDENT 
UNINDENT 

Definition at line 188 of file cpp_printer.cpp.

Special objects that affect output when printed.

Enumerator:
blank 

Set one indentation to two spaces.

stroke 

Set one indentation to "| ".

indent 

Increment indentation.

unindent 

Decrement indentation.

lf 

Carriage return and indent the new line.

hrule 

Output 80 consecutive dashes.

flush_now 

Flush the buffer.

Definition at line 38 of file basix.hpp.


Function Documentation

sparse_vector<C,T,V> mmx::_mul_add ( const sparse_vector< C, T, V > &  v1,
const sparse_vector< C, T, V > &  v2,
const C &  x 
)

Definition at line 308 of file sparse_vector.hpp.

References C, is_exact_zero(), n, N(), Pair, and Sparse_vector.

                                                                        {
  // v1 + x * v2
  typedef typename V::val_op Eq;
  typedef typename V::l_op Less;
  if (is_exact_zero (x)) return v1;
  nat i1, i2, n1= N(v1), n2= N(v2), j, n= n1 + n2;
  Pair* r= mmx_new<Pair > (n);
  for (i1= i2= j= 0; i1 < n1 && i2 < n2; ) {
    if (Less::op (v1[i1].x1, v2[i2].x1)) {
      r[j++]= v1[i1]; i1++;
    }
    else if (Less::op (v2[i2].x1, v1[i1].x1)) {
      r[j++]= Pair (v2[i2].x1, Mul::op (x, v2[i2].x2)); i2++;
    }
    else {
      Pair e (v2[i2].x1, v1[i1].x2 + Mul::op (x, v2[i2].x2));
      i1++; i2++; if (Eq::not_op (e.x2, C (0))) r[j++]= e;
    }
  }
  while (i1 < n1) {
    r[j++]= Pair (v1[i1].x1, v1[i1].x2); i1++;
  }
  while (i2 < n2) {
    r[j++]= Pair (v2[i2].x1,  Mul::op (x, v2[i2].x2)); i2++;
  }
  return Sparse_vector (r, j, n);
}
C mmx::abs ( const C &  x) [inline]
generic abs ( const generic x1)

Definition at line 729 of file generic.cpp.

References current_ev, and GEN_ABS.

                                {
  return current_ev->apply (GEN_ABS, x1); }
syntactic abs ( const syntactic g1)

Definition at line 426 of file syntactic.cpp.

References GEN_ABS, and syn().

{ return syn (GEN_ABS, g1); }
unsigned char mmx::abs ( const unsigned char &  x) [inline]

Definition at line 495 of file defaults.hpp.

{ return x; }    
short unsigned int mmx::abs ( const short unsigned int &  x) [inline]

Definition at line 498 of file defaults.hpp.

{ return x; }    
vector<Abs_type(C),V> mmx::abs ( const vector< C, V > &  v)

Definition at line 1153 of file vector.hpp.

{ return unary_map<abs_op> (v); }
unsigned int mmx::abs ( const unsigned int &  x) [inline]

Definition at line 501 of file defaults.hpp.

{ return x; }    
long unsigned int mmx::abs ( const long unsigned int &  x) [inline]

Definition at line 504 of file defaults.hpp.

{ return x; }    
long long unsigned int mmx::abs ( const long long unsigned int &  x) [inline]

Definition at line 507 of file defaults.hpp.

{ return x; }
unary_return_type_helper<abs_op, C >::RET mmx::abs_down ( const C &  x) [inline]

Definition at line 893 of file type_props.hpp.

References abs().

{ return abs (x); }
unary_return_type_helper<abs_op, C >::RET mmx::abs_up ( const C &  x) [inline]

Definition at line 895 of file type_props.hpp.

References abs().

{ return abs (x); }
vector<generic> mmx::abstract_vector ( const generic conc) [inline]

Definition at line 283 of file vector.hpp.

                                      {
  return as<vector<generic> > (conc->make_abstract_vector ());
}
void mmx::accelerate ( const generic name,
C(*)(const C &)  f 
)

Definition at line 83 of file glue.hpp.

References ACC_ACOS, ACC_ACOSH, ACC_ASIN, ACC_ASINH, ACC_ATAN, ACC_ATANH, ACC_COS, ACC_COSH, ACC_DERIVE, ACC_EXP, ACC_INTEGRATE, ACC_INVERT, ACC_LOG, ACC_NEGATE, ACC_SIN, ACC_SINH, ACC_SQRT, ACC_SQUARE, ACC_TAN, ACC_TANH, GEN_ARCCOS, GEN_ARCSIN, GEN_ARCTAN, GEN_ARGCH, GEN_ARGSH, GEN_ARGTH, GEN_CH, GEN_COS, GEN_DERIVE, GEN_EXP, GEN_INTEGRATE, GEN_INVERT, GEN_LOG, GEN_MINUS, GEN_SH, GEN_SIN, GEN_SQRT, GEN_SQUARE, GEN_TAN, GEN_TH, and unary_routine().

                                                    {
  routine fun= unary_routine (name, f);
  if (name == GEN_MINUS)
    Acc::set_apply (ACC_NEGATE, fun);
  else if (name == GEN_SQUARE)
    Acc::set_apply (ACC_SQUARE, fun);
  else if (name == GEN_INVERT)
    Acc::set_apply (ACC_INVERT, fun);
  else if (name == GEN_SQRT)
    Acc::set_apply (ACC_SQRT, fun);
  else if (name == GEN_EXP)
    Acc::set_apply (ACC_EXP, fun);
  else if (name == GEN_LOG)
    Acc::set_apply (ACC_LOG, fun);
  else if (name == GEN_COS)
    Acc::set_apply (ACC_COS, fun);
  else if (name == GEN_SIN)
    Acc::set_apply (ACC_SIN, fun);
  else if (name == GEN_TAN)
    Acc::set_apply (ACC_TAN, fun);
  else if (name == GEN_CH)
    Acc::set_apply (ACC_COSH, fun);
  else if (name == GEN_SH)
    Acc::set_apply (ACC_SINH, fun);
  else if (name == GEN_TH)
    Acc::set_apply (ACC_TANH, fun);
  else if (name == GEN_ARCCOS)
    Acc::set_apply (ACC_ACOS, fun);
  else if (name == GEN_ARCSIN)
    Acc::set_apply (ACC_ASIN, fun);
  else if (name == GEN_ARCTAN)
    Acc::set_apply (ACC_ATAN, fun);
  else if (name == GEN_ARGCH)
    Acc::set_apply (ACC_ACOSH, fun);
  else if (name == GEN_ARGSH)
    Acc::set_apply (ACC_ASINH, fun);
  else if (name == GEN_ARGTH)
    Acc::set_apply (ACC_ATANH, fun);
  else if (name == GEN_DERIVE)
    Acc::set_apply (ACC_DERIVE, fun);
  else if (name == GEN_INTEGRATE)
    Acc::set_apply (ACC_INTEGRATE, fun);
}
void mmx::accelerate ( const generic ,
C(*)(const S1 &, const S2 &)   
) [inline]

Definition at line 128 of file glue.hpp.

{}
void mmx::accelerate ( const generic name,
C(*)(const C &, const C &)  f 
)

Definition at line 131 of file glue.hpp.

References ACC_ADD, ACC_ATAN2, ACC_DIV, ACC_HYPOT, ACC_MUL, ACC_POW, ACC_SUB, binary_routine(), GEN_ARCTAN2, GEN_HYPOT, GEN_MINUS, GEN_OVER, GEN_PLUS, GEN_POWER, and GEN_TIMES.

                                                              {
  routine fun= binary_routine (name, f);
  if (name == GEN_PLUS)
    Acc::set_apply (ACC_ADD, fun);
  else if (name == GEN_MINUS)
    Acc::set_apply (ACC_SUB, fun);
  else if (name == GEN_TIMES)
    Acc::set_apply (ACC_MUL, fun);
  else if (name == GEN_OVER)
    Acc::set_apply (ACC_DIV, fun);
  else if (name == GEN_HYPOT)
    Acc::set_apply (ACC_HYPOT, fun);
  else if (name == GEN_ARCTAN2)
    Acc::set_apply (ACC_ATAN2, fun);
  else if (name == GEN_POWER)
    Acc::set_apply (ACC_POW, fun);
}
void mmx::accelerate ( const generic name,
bool(*)(const C &, const C &)  f 
)

Definition at line 150 of file glue.hpp.

References ACC_GTR, ACC_GTREQ, ACC_LESS, ACC_LESSEQ, binary_routine(), GEN_GTR, GEN_GTREQ, GEN_LESS, and GEN_LESSEQ.

                                                                 {
  routine fun= binary_routine (name, f);
  if (name == GEN_LESS)
    Acc::set_apply (ACC_LESS, fun);
  else if (name == GEN_LESSEQ)
    Acc::set_apply (ACC_LESSEQ, fun);
  else if (name == GEN_GTR)
    Acc::set_apply (ACC_GTR, fun);
  else if (name == GEN_GTREQ)
    Acc::set_apply (ACC_GTREQ, fun);
}
void mmx::accelerate ( const generic ,
bool(*)(const bool &, const bool &)   
) [inline]

Definition at line 163 of file glue.hpp.

{}
void mmx::accelerate ( const generic name,
C(*)(const S1 &)  f 
) [inline]

Definition at line 77 of file glue.hpp.

References accelerate_converter(), and GEN_CAST.

Referenced by define().

                                                     {
  if (name == GEN_CAST)
    accelerate_converter (name, f);
}
void mmx::accelerate_converter ( const generic name,
C(*)(const S1 &)  f 
)

Definition at line 56 of file glue.hpp.

References gen(), GEN_INTO, and unary_routine().

Referenced by accelerate(), and define_converter().

                                                               {
  (void) name;
  accelerate_initialize<C> ();
  accelerate_initialize<S1> ();
  generic con= gen (GEN_INTO, type_name<S1> (), type_name<C> ());
  routine fun= unary_routine (con, f);
  Acc::set_construct (accelerator<S1>::id, fun);
}
void mmx::accelerate_converter ( const generic ,
int(*)(const generic_alias< S > &)   
) [inline]

Definition at line 74 of file glue.hpp.

{}
void mmx::accelerate_converter ( const generic ,
C(*)(const alias< S > &)   
) [inline]

Definition at line 66 of file glue.hpp.

{}
void mmx::accelerate_converter ( const generic ,
int(*)(const alias< S > &)   
) [inline]

Definition at line 72 of file glue.hpp.

{}
void mmx::accelerate_converter ( const generic ,
C(*)(const generic_alias< S > &)   
) [inline]

Definition at line 68 of file glue.hpp.

{}
void mmx::accelerate_converter ( const generic ,
int(*)(const S &)   
) [inline]

Definition at line 70 of file glue.hpp.

{}
void mmx::accelerate_initialize ( )

Definition at line 50 of file glue.hpp.

References accelerate_number().

                         {
  if (Acc::id == ((nat) (-1)))
    Acc::id= accelerate_number ();
}
nat accelerate_number ( )

Definition at line 99 of file glue.cpp.

Referenced by accelerate_initialize().

                     {
  static nat nr_ids= 0;
  return nr_ids++;
}
port mmx::accept ( const port &  p) [inline]

Definition at line 117 of file port.hpp.

References inside().

Referenced by GLUE_20().

                                   {
  return inside (p)->accept (); }
syntactic access ( const syntactic g,
const syntactic i 
)

Definition at line 481 of file syntactic.cpp.

References GEN_ACCESS, and syn().

                                                          {
  return syn (GEN_ACCESS, g, i); }
syntactic access ( const syntactic g,
const syntactic i,
const syntactic j 
)

Definition at line 483 of file syntactic.cpp.

References GEN_ACCESS, and syn().

                                                                              {
  return syn (GEN_ACCESS, g, i, j); }
generic access ( const generic f,
const generic x 
)

Definition at line 181 of file generic.cpp.

References gen(), and GEN_ACCESS.

Referenced by trig_op::diff_op(), and binary_helper< generic >::disassemble().

                                                    {
  return gen (GEN_ACCESS, g, x); }
generic access ( const generic f,
const generic x,
const generic y 
)

Definition at line 183 of file generic.cpp.

References gen(), and GEN_ACCESS.

                                                                      {
  return gen (GEN_ACCESS, g, x, y); }
generic access ( const generic f,
const vector< generic > &  x 
)

Definition at line 185 of file generic.cpp.

References append(), GEN_ACCESS, and vector_to_compound().

                                                               {
  vector<generic> v= vec<generic> (generic (GEN_ACCESS), g);
  return vector_to_compound (append (v, args)); }
C mmx::accuracy_cst ( ) [inline]

Definition at line 753 of file type_props.hpp.

References C, and set_accuracy().

{ C r; set_accuracy (r); return r; }
double acos ( const double &  x) [inline]

Definition at line 54 of file double.hpp.

Referenced by GLUE_40(), acos_op::op(), and acos_op::set_op().

{ return std::acos (x); }
syntactic acos ( const syntactic g)

Definition at line 407 of file syntactic.cpp.

References GEN_ARCCOS, and syn().

{ return syn (GEN_ARCCOS, g); }
generic acos ( const generic x1)

Definition at line 462 of file generic.cpp.

References ACC_ACOS, ACC_UNARY, current_ev, and GEN_ARCCOS.

                         {
  ACC_UNARY (ACC_ACOS, x1);
  return current_ev->apply (GEN_ARCCOS, x1);
}
vector<C,V> mmx::acos ( const vector< C, V > &  v)

Definition at line 1088 of file vector.hpp.

{ return unary_map<acos_op> (v); }
generic acos_init ( const generic x,
const generic c 
)

Definition at line 805 of file generic.cpp.

References current_ev.

Referenced by acos_op::op_init().

                                                         {
  return current_ev->apply ("acos_init", x1, x2); }
syntactic acos_init ( const syntactic x,
const syntactic c 
)

Definition at line 467 of file syntactic.cpp.

References syn().

                                                             {
  return syn ("acos_init", x, c); }
generic acosh ( const generic x1)

Definition at line 498 of file generic.cpp.

References ACC_ACOSH, ACC_UNARY, log(), sqrt(), and square().

                          {
  ACC_UNARY (ACC_ACOSH, x1);
  return log (x1 + sqrt (square (x1) - 1));
}
syntactic acosh ( const syntactic g)

Definition at line 413 of file syntactic.cpp.

References GEN_ARGCH, and syn().

{ return syn (GEN_ARGCH, g); }
C mmx::acosh ( const C &  x) [inline]

Definition at line 593 of file defaults.hpp.

References log(), promote(), sqrt(), and square().

Referenced by acosh_op::op(), and acosh_op::set_op().

                                                 {
  return log (x + sqrt (square (x) - promote (1, x))); }
void mmx::add ( R &  x,
const C1 &  y1,
const C2 &  y2 
) [inline]

Definition at line 52 of file operators.hpp.

Referenced by ladd_op::set_op(), radd_op::set_op(), and add_op::set_op().

{ x= y1 + y2; }
string add_indentation ( const string s,
int  delta 
)

Definition at line 597 of file string.cpp.

References ASSERT, min(), N(), recompose(), repeated(), s, and tokenize().

Referenced by source_string_unindented().

                                             {
  if (delta == 0) return s;
  vector<string> v= tokenize (s, "\n");
  for (nat i=0; i<N(v); i++)
    if (delta > 0) v[i]= repeated (" ", delta) * v[i];
    else {
      int l= min (-delta, (int) N(v[i]));
      ASSERT (v[i] (0, l) == repeated (" ", l), "insufficient indentation");
      v[i]= v[i] (l, N(v[i]));
    }
  return recompose (v, "\n", N(s) != 0 && s[N(s) - 1] == '\n');
}
generic add_modes ( const generic g,
int  mode 
)

Definition at line 77 of file mmx_texmacs.cpp.

References compound_to_vector(), copy(), is_func(), N(), and vector_to_compound().

Referenced by add_modes(), as_texmacs_scheme(), and as_texmacs_snippet().

                                       {
  // mmerr << as_lisp (g) << ", " << mode << "\n";
  if (!is<compound> (g) || !is<literal> (g[0])) return g;
  if (is_func (g, "$math", 1)) return add_modes (g[1], mode, 1);
  if (is_func (g, "$text", 1)) return add_modes (g[1], mode, 2);
  if (is_func (g, "$inmath", 1)) return add_modes (g[1], 1);
  if (is_func (g, "$intext", 1)) return add_modes (g[1], 2);
  vector<generic> v= copy (compound_to_vector (g));
  for (nat i=1; i<N(v); i++) v[i]= add_modes (v[i], mode);
  return vector_to_compound (v);
}
generic mmx::add_modes ( const generic g,
int  mode,
int  new_mode 
)

Definition at line 64 of file mmx_texmacs.cpp.

References add_modes(), gen(), and is_func().

                                                     {
  // mmerr << as_lisp (g) << ", " << mode << ", " << new_mode << "\n";
  generic r= add_modes (g, new_mode);
  if (is_func (r, "$concat", 1)) r= r[1];
  if (mode == new_mode) return r;
  else if (is_func (r, "$math", 1)) return r;
  else if (is_func (r, "$text", 1)) return r;
  else if (new_mode == 1) return gen ("$math", r);
  else if (new_mode == 2) return gen ("$text", r);
  else return r;
}
T mmx::add_operator ( const T &  x,
const T &  y 
)

Definition at line 29 of file operators.hpp.

{ return x+y; }
double mmx::additive_error ( const double &  x) [inline]

Definition at line 87 of file double.hpp.

References abs().

Referenced by additive_error_op::Abs_type(), GLUE_46(), and additive_error_op::set_op().

                                               {
  return ldexp (abs (x), -50); }
generic additive_error ( const generic x)

Definition at line 773 of file generic.cpp.

References current_ev, and GEN_ADDITIVE_ERROR.

                                          {
  return current_ev->apply (GEN_ADDITIVE_ERROR, x); }
unary_return_type_helper<abs_op, C >::RET mmx::additive_error ( const C &  x) [inline]

Definition at line 868 of file type_props.hpp.

References rounding_error().

                                                                    {
  return rounding_error (x); }
alias<C> mmx::alias_access ( const alias< R > &  r,
const A &  a 
) [inline]

Definition at line 241 of file alias.hpp.

                                             {
  return new alias_unary_access_rep<C,R,A> (r, a);
}
alias<C> mmx::alias_access ( const alias< R > &  r,
const A &  a,
const B &  b 
) [inline]

Definition at line 260 of file alias.hpp.

                                                         {
  return new alias_binary_access_rep<C,R,A,B> (r, a, b);
}
void alias_getter ( nat  id,
routine r 
)

Definition at line 68 of file alias.cpp.

References is_nil(), and read().

Referenced by define_type_helper< C >::def_type(), define_user_type(), and get_alias().

                                  {
  static table<routine,nat> t;
  if (is_nil (r)) r= read (t, id);
  else t[id]= r;
}
void mmx::alias_glue ( const alias< R > &  r,
const A &  a,
const B &  b 
) [inline]

Definition at line 278 of file alias.hpp.

                                                       {
  glue (r->open (), a, b);
  r->close ();
}
void mmx::alias_reset ( const alias< R > &  r,
const A &  a 
) [inline]

Definition at line 265 of file alias.hpp.

References reset().

Referenced by GLUE_13(), and GLUE_8().

                                            {
  reset (r->open (), a);
  r->close ();
}
void alias_setter ( nat  id,
routine r 
)

Definition at line 82 of file alias.cpp.

References is_nil(), and read().

Referenced by define_type_helper< C >::def_type(), define_user_type(), and set_alias().

                                  {
  static table<routine,nat> t;
  if (is_nil (r)) r= read (t, id);
  else t[id]= r;
}
void alias_specializer ( nat  id,
routine r 
)

Definition at line 53 of file alias.cpp.

References is_nil(), and read().

Referenced by define_type_helper< C >::def_type(), define_user_type(), and specialize_alias().

                                       {
  static table<routine,nat> t;
  if (is_nil (r)) r= read (t, id);
  else t[id]= r;
}
nat mmx::alias_to_scalar ( nat  id) [inline]

Definition at line 189 of file alias.hpp.

References alias_type_info().

                         {
  int mode= 0;
  alias_type_info (id, mode);
  return id;
}
void alias_type_info ( nat id,
int &  mode 
)

Definition at line 19 of file alias.cpp.

References ERROR, new_type_id(), and read().

Referenced by alias_to_scalar(), is_alias_type(), new_alias_type_id(), new_generic_alias_type_id(), and scalar_to_alias().

                                     {
  static table<nat,nat> t (0);
  static table<nat,nat> u (0);
  static table<nat,nat> v (0);
  if (mode == 0) {
    mode= t->contains (id)? 1: 0;
    id= read (t, id);
  }
  else if (mode == 1) {
    mode= u->contains (id)? 1: 0;
    id= read (u, id);
  }
  else if (mode == 2) {
    if (u->contains (id)) id= u[id];
    else {
      nat new_id= new_type_id ();
      t[new_id]= id;
      u[id]= new_id;
      id= new_id;
    }
  }
  else if (mode == 3) {
    if (v->contains (id)) id= v[id];
    else {
      nat new_id= new_type_id ();
      t[new_id]= id;
      v[id]= new_id;
      id= new_id;
    }
  }
  else ERROR ("wrong mode");
}
alias<R> mmx::alias_write ( const alias< R > &  r,
const A &  a 
) [inline]

Definition at line 271 of file alias.hpp.

Referenced by GLUE_10(), GLUE_11(), and GLUE_5().

                                            {
  r->open () << a;
  r->close ();
  return r;
}
nat mmx::aligned_size ( nat  n) [inline]

Definition at line 70 of file vector_naive.hpp.

References n.

                     {
  typedef implementation<vector_allocate,V> Vec;
  return Vec::template vec_aligned_size<C> (n);
}
vector< generic > all_type_names ( )

Definition at line 59 of file glue.cpp.

References as(), current_ev, gen(), and GEN_ALL_TYPES.

Referenced by define_type_sub().

                  {
  generic ret;
  if (current_ev->get (gen (GEN_ALL_TYPES), ret))
    return as<vector<generic> > (ret);
  return vec<generic> ();
}
bool mmx::always_false ( const C &  x) [inline]

Definition at line 741 of file defaults.hpp.

                          {
  (void) x; return false;
}
bool mmx::always_true ( const C &  x) [inline]

Definition at line 746 of file defaults.hpp.

                         {
  (void) x; return true;
}
table<C,T,V> mmx::append ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
)

Definition at line 724 of file table.hpp.

References busy(), CF2(), entries(), I(), simplify(), and Table.

                                        {
  Table r (I (u), CF2(t));
  for (iterator<T> it= entries (t); busy (it); ++it)
    r[*it]= t[*it];
  simplify (r);
  for (iterator<T> it= entries (u); busy (it); ++it)
    r[*it]= u[*it];
  return r;
}
vector<C,V> mmx::append ( const vector< C, V > &  v,
const C &  c 
)

Definition at line 609 of file vector.hpp.

References ASSERT, C, CF(), copy(), is_non_scalar(), N(), n, seg(), and Vector.

                                     {
  typedef implementation<vector_linear,V> Vec;
  ASSERT (is_non_scalar (v), "non-scalar vector expected");
  nat n= N(v);
  nat l= aligned_size<C,V> (n+1);
  C* a= mmx_formatted_new<C> (l, CF(v));
  a[n]= c;
  Vec::copy (a, seg (v), n);
  return Vector (a, n+1, l, CF(v));
}
vector<C,V> mmx::append ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 621 of file vector.hpp.

References ASSERT, C, CF(), copy(), is_non_scalar(), N(), n, seg(), and Vector.

                                          {
  typedef implementation<vector_linear,V> Vec;
  ASSERT (is_non_scalar (v) && is_non_scalar (w),
          "non-scalar vectors expected");
  nat n= N(v), p= N(w);
  nat l= aligned_size<C,V> (n+p);
  C* a= mmx_formatted_new<C> (l, CF(v));
  Vec::copy (a, seg (v), n);
  Vec::copy (a+n, seg (w), p);
  return Vector (a, n+p, l, CF(v));
}
list<C> mmx::append ( const list< C > &  l1,
const list< C > &  l2 
)

Return a list comprising all the elements of l1 and l2.

Definition at line 282 of file list.hpp.

References append(), car(), cdr(), cons(), copy(), and is_nil().

                                        {
  if (is_nil (l1)) return copy (l2);
  return cons (car (l1), append (cdr (l1), l2));
}
syntactic mmx::apply ( const vector< syntactic > &  v)

Definition at line 29 of file syntactic.cpp.

References as_string(), as_syntactic(), N(), pow(), s, vector_to_compound(), and VERIFY.

                                   {
  VERIFY (N(v) != 0, "non-empty vector expected");
  if (is<literal> (*v[0])) {
    string s= as_string (as<literal> (*v[0]));
    if (N(s) == 1) {
      if (s[0] == '-' && N(v) == 2) return -v[1];
      if (s[0] == '+' && N(v) == 3) return v[1] + v[2];
      if (s[0] == '-' && N(v) == 3) return v[1] - v[2];
      if (s[0] == '*' && N(v) == 3) return v[1] * v[2];
      if (s[0] == '/' && N(v) == 3) return v[1] / v[2];
      if (s[0] == '^' && N(v) == 3) return pow (v[1], v[2]);
    }
  }
  return as_syntactic (vector_to_compound (*((vector<generic>*) (void*) &v)));
}
syntactic apply ( const syntactic f)

Definition at line 45 of file syntactic.cpp.

References apply(), and vec().

                                     {
  return apply (vec (f)); }
syntactic apply ( const syntactic f,
const syntactic a1 
)

Definition at line 47 of file syntactic.cpp.

References apply(), and vec().

                                                          {
  return apply (vec (f, a1)); }
syntactic apply ( const syntactic f,
const syntactic a1,
const syntactic a2 
)

Definition at line 49 of file syntactic.cpp.

References apply(), and vec().

                                      {
  return apply (vec (f, a1, a2)); }
syntactic apply ( const syntactic f,
const syntactic a1,
const syntactic a2,
const syntactic a3 
)

Definition at line 52 of file syntactic.cpp.

References apply(), and vec().

                                                           {
  return apply (vec (f, a1, a2, a3)); }
syntactic apply ( const syntactic f,
const syntactic a1,
const syntactic a2,
const syntactic a3,
const syntactic a4 
)

Definition at line 55 of file syntactic.cpp.

References apply(), and vec().

                                                           {
  return apply (vec (f, a1, a2, a3, a4)); }
syntactic apply ( const syntactic f,
const syntactic a1,
const syntactic a2,
const syntactic a3,
const syntactic a4,
const syntactic a5 
)

Definition at line 59 of file syntactic.cpp.

References apply(), and vec().

                                      {
  return apply (vec (f, a1, a2, a3, a4, a5)); }
syntactic apply ( const syntactic f,
const syntactic a1,
const syntactic a2,
const syntactic a3,
const syntactic a4,
const syntactic a5,
const syntactic a6 
)

Definition at line 64 of file syntactic.cpp.

References apply(), and vec().

                                                           {
  return apply (vec (f, a1, a2, a3, a4, a5, a6)); }
syntactic apply ( const syntactic f,
const vector< syntactic > &  a 
)

Definition at line 69 of file syntactic.cpp.

References apply(), and cons().

                                                                 {
  return apply (cons (f, a)); }
syntactic mmx::apply ( const char *  f) [inline]

Definition at line 162 of file syntactic.hpp.

References apply().

                                       {
  return apply (syntactic (f)); }
syntactic mmx::apply ( const char *  f,
const syntactic &  a1 
) [inline]

Definition at line 164 of file syntactic.hpp.

References apply().

                                                            {
  return apply (syntactic (f), a1); }
syntactic mmx::apply ( const char *  f,
const syntactic &  a1,
const syntactic &  a2 
) [inline]

Definition at line 166 of file syntactic.hpp.

References apply().

                                             {
  return apply (syntactic (f), a1, a2); }
syntactic mmx::apply ( const char *  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3 
) [inline]

Definition at line 169 of file syntactic.hpp.

References apply().

                                                                  {
  return apply (syntactic (f), a1, a2, a3); }
syntactic mmx::apply ( const char *  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3,
const syntactic &  a4 
) [inline]

Definition at line 172 of file syntactic.hpp.

References apply().

                                                                  {
  return apply (syntactic (f), a1, a2, a3, a4); }
syntactic mmx::apply ( const char *  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3,
const syntactic &  a4,
const syntactic &  a5 
) [inline]

Definition at line 176 of file syntactic.hpp.

References apply().

                                             {
  return apply (syntactic (f), a1, a2, a3, a4, a5); }
syntactic mmx::apply ( const char *  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3,
const syntactic &  a4,
const syntactic &  a5,
const syntactic &  a6 
) [inline]

Definition at line 181 of file syntactic.hpp.

References apply().

                                                                  {
  return apply (syntactic (f), a1, a2, a3, a4, a5, a6); }
syntactic mmx::apply ( const char *  f,
const vector< syntactic > &  a 
) [inline]

Definition at line 186 of file syntactic.hpp.

References apply().

                                                                   {
  return apply (syntactic (f), a); }
syntactic mmx::apply ( const generic &  f) [inline]

Definition at line 189 of file syntactic.hpp.

References apply(), and as_syntactic().

                                          {
  return apply (as_syntactic (f)); }
syntactic mmx::apply ( const generic &  f,
const syntactic &  a1 
) [inline]

Definition at line 191 of file syntactic.hpp.

References apply(), and as_syntactic().

                                                               {
  return apply (as_syntactic (f), a1); }
syntactic mmx::apply ( const generic &  f,
const syntactic &  a1,
const syntactic &  a2 
) [inline]

Definition at line 193 of file syntactic.hpp.

References apply(), and as_syntactic().

                                             {
  return apply (as_syntactic (f), a1, a2); }
syntactic mmx::apply ( const generic &  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3 
) [inline]

Definition at line 196 of file syntactic.hpp.

References apply(), and as_syntactic().

                                                                  {
  return apply (as_syntactic (f), a1, a2, a3); }
syntactic mmx::apply ( const generic &  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3,
const syntactic &  a4 
) [inline]

Definition at line 199 of file syntactic.hpp.

References apply(), and as_syntactic().

                                                                  {
  return apply (as_syntactic (f), a1, a2, a3, a4); }
syntactic mmx::apply ( const generic &  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3,
const syntactic &  a4,
const syntactic &  a5 
) [inline]

Definition at line 203 of file syntactic.hpp.

References apply(), and as_syntactic().

                                             {
  return apply (as_syntactic (f), a1, a2, a3, a4, a5); }
syntactic mmx::apply ( const generic &  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3,
const syntactic &  a4,
const syntactic &  a5,
const syntactic &  a6 
) [inline]

Definition at line 208 of file syntactic.hpp.

References apply(), and as_syntactic().

                                                                  {
  return apply (as_syntactic (f), a1, a2, a3, a4, a5, a6); }
syntactic mmx::apply ( const generic &  f,
const vector< syntactic > &  a 
) [inline]

Definition at line 213 of file syntactic.hpp.

References apply(), and as_syntactic().

                                                                      {
  return apply (as_syntactic (f), a); }
generic apply ( const generic f,
const generic x,
const generic y,
const generic z 
)

Definition at line 270 of file generic.cpp.

References current_ev, and vec().

                                                   {
  return current_ev->apply (g, vec (x, y, z)); }
generic apply ( const generic f,
const generic x,
const generic y 
)

Definition at line 268 of file generic.cpp.

References current_ev.

                                                                     {
  return current_ev->apply (g, x, y); }
generic apply ( const generic f,
const vector< generic > &  x 
)

Definition at line 273 of file generic.cpp.

References current_ev.

                                                              {
  return current_ev->apply (g, args); }
generic mmx::apply ( const routine fun,
const vector< dynamic > &  args 
)

Definition at line 178 of file dynamic.cpp.

References N(), and val.

                                                        {
  vector<generic> a= fill<generic> (N (args));
  for (nat i= 0; i<N(a); i++)
    a[i]= args[i]->val;
  generic r= fun->apply (a);
  return r;
}
generic arg ( const generic x1)

Definition at line 731 of file generic.cpp.

References current_ev, and GEN_ARG.

Referenced by INDIRECT_IMPL(), arg_op::op(), arg_op::Real_type(), arg_op::set_op(), and vector_map_n().

                                {
  return current_ev->apply (GEN_ARG, x1); }
syntactic arg ( const syntactic g1)

Definition at line 427 of file syntactic.cpp.

References GEN_ARG, and syn().

{ return syn (GEN_ARG, g1); }
double mmx::ARG_HYPER_SUGAR ( double  ) const

Definition at line 70 of file double.hpp.

                                        { return std::isfinite (x); }
observer mmx::argument_observer ( dynamic_rep arg,
const updater u 
)

Definition at line 152 of file dynamic.cpp.

References observer.

                                                       {
  return observer (new argument_observer_rep (arg, u));
}
vector< syntactic > arguments ( const syntactic g)

Definition at line 93 of file syntactic.cpp.

References cdr(), and components().

                               {
  return cdr (components (g));
}
T as ( const F &  x) [inline]
bool mmx::as_bool ( const generic g) [inline]

Definition at line 292 of file generic.cpp.

Referenced by operator<(), operator<=(), operator==(), operator>(), and operator>=().

                                       {
  return is<bool> (g) && as<bool> (g); }
char * as_charp ( const string s)

Return a pointer to a copy of s. The allocated memory must be freed with free_charp.

Definition at line 74 of file string.cpp.

References mmx_malloc(), n, and N().

Referenced by dl_link(), file_exists(), file_is_script(), follow_link(), get_env(), input_file_port(), input_output_file_port(), load_directory(), output_file_port(), socket_client_port(), system(), and var_mkdir().

                           {
  nat i, n= N(s);
  char* r= (char*) mmx_malloc (n+1);
  for (i=0; i<n; i++) r[i]= s[i];
  r[i]= '\0';
  return r;
}
string as_cpp ( const generic g)

Definition at line 1218 of file cpp_printer.cpp.

References inside(), N(), and cpp_printer::pp().

Referenced by flatten_as_cpp().

                          {
  cpp_printer pp;
  pp.pp (g);
  while (N (pp.out) > 0 && pp.out [N (pp.out) - 1] == '\n')
    inside (pp.out) -> resize (N (pp.out) - 1);
  return pp.out;
}
document mmx::as_document ( const generic g) [inline]
vector<document> mmx::as_documents ( const vector< generic > &  v)

Definition at line 38 of file document.cpp.

References as_document(), and N().

Referenced by make_document().

                                        {
  vector<document> r= fill<document> (N(v));
  for (nat i=0; i<N(v); i++) r[i]= as_document (v[i]);
  return r;
}
double as_double ( const string s)

Definition at line 180 of file string.cpp.

References max(), and N().

                            {
  double x;
  char buffer[100];
  strncpy (buffer, s->a, 99);
  buffer[max(N(s),(nat) 99)]= '\0';
  sscanf (buffer, "%lf", &x);
  return x;
}
double mmx::as_double ( const double &  x) [inline]
Examples:
string_test.cpp.

Definition at line 120 of file double.hpp.

{ return x; }
exception mmx::as_exception ( const generic x) [final]

Definition at line 39 of file basix.cpp.

References exception.

                                {
  return exception (x);
}
generic mmx::as_generic ( const syntactic &  g) [inline]

Definition at line 49 of file syntactic.hpp.

{ return *g; }
generic mmx::as_generic ( const C &  c)

Definition at line 558 of file generic.hpp.

References construct().

                        {
  return construct (new generic_concrete_rep<C> (c));
}
generic as_generic ( const generic obj,
nat  tp_id 
)

Definition at line 210 of file generic_object.cpp.

References ASSERT, and type().

                                         {
  ASSERT (type (g) == tp_id, "type mismatch");
  return ((generic_object_rep*) inspect (g)) -> rep;
};
generic as_generic ( const generic obj,
const generic tp 
)

Definition at line 216 of file generic_object.cpp.

References ASSERT, and type().

                                                 {
  ASSERT (type (g) == get_user_type (tp), "type mismatch");
  return ((generic_object_rep*) inspect (g)) -> rep;
};
vector<generic> mmx::as_generics ( const vector< document > &  v)

Definition at line 31 of file document.cpp.

References as_generic(), and N().

Referenced by make_row(), and make_texmacs().

                                        {
  vector<generic> r= fill<generic> (N(v));
  for (nat i=0; i<N(v); i++) r[i]= as_generic (v[i]);
  return r;
}
nat mmx::as_hash ( const C *  p) [inline]

Definition at line 157 of file basix.hpp.

References uintptr_t.

Referenced by exact_hash(), hard_hash(), and hash().

                                                     {
  return ((nat) ((uintptr_t) ((void*) p))) >> 3; }
int as_int ( const string s)

Definition at line 137 of file string.cpp.

References N(), and val.

                         {
  int i=0, n=N(s), val=0;
  if (n==0) return 0;
  if (s[0]=='-') i++;
  while (i<n) {
    if (s[i]<'0') break;
    if (s[i]>'9') break;
    val *= 10;
    val += (int) (s[i]-'0');
    i++;
  }
  if (s[0]=='-') val=-val;
  return val;
}
int mmx::as_int ( const double &  x) [inline]
Examples:
string_test.cpp.

Definition at line 119 of file double.hpp.

Referenced by GLUE_2(), and GLUE_3().

{ return (int) x; }
static void mmx::as_lisp ( string out,
const generic g,
bool  quote_flag,
bool  fun_flag 
) [static]

Definition at line 19 of file lisp_printer.cpp.

References as_generic(), as_lisp(), flatten(), literal_to_string(), N(), n, and quote().

                                                                        {
  if (is<literal> (g)) {
    if (quote_flag && !fun_flag) out << quote (literal_to_string (g));
    else out << literal_to_string (g);
  }
  else if (is<compound> (g)) {
    nat i, n= N (g);
    out << "(";
    if (n>0) as_lisp (out, g[0], quote_flag, true);
    for (i=1; i<n; i++) {
      out << " ";
      as_lisp (out, g[i], quote_flag, false);
    }
    out << ")";
  }
  else {
    generic f= as_generic (flatten (g));
    as_lisp (out, f, quote_flag, fun_flag);
  }
}
string as_lisp ( const generic g,
bool  quote_flag = true 
)

Definition at line 41 of file lisp_printer.cpp.

Referenced by as_lisp(), and flatten_as_lisp().

                                            {
  string out;
  as_lisp (out, g, quote_flag, false);
  return out;
}
static void mmx::as_math ( string out,
const generic g 
) [static]

Definition at line 134 of file math_printer.cpp.

References as_generic(), as_math(), exact_eq(), flatten(), GEN_ROW, GEN_SQTUPLE, literal_to_string(), math_symbol_table(), n, N(), and s.

                                        {
  static table<string, string, exact_eq_table> t (math_symbol_table ());
  if (is<literal> (g)) {
    string tmp;
    string s (literal_to_string (g));
    if (t->get (s, tmp))
      out << tmp;
    else if (N(s) > 0 && s[0]>='0' && s[0] <= '9')
      out << "\"" << s << "\"";
    else
      out << s;
  }
  else if (is<compound> (g)) {
    nat i, n= N (g);
    out << "(";
    if (n>0) {
      if (exact_eq (g[0], GEN_SQTUPLE) && n>1 &&
          is<compound> (g[1]) && exact_eq (g[1][0], GEN_ROW))
        out << "matrix";
      else as_math (out, g[0]);
    }
    for (i=1; i<n; i++) {
      out << " ";
      as_math (out, g[i]);
    }
    out << ")";
  }
  else {
    generic f= as_generic (flatten (g));
    as_math (out, f);
  }
}
string as_math ( const generic g)

Definition at line 168 of file math_printer.cpp.

Referenced by as_math(), and flatten_as_math().

                           {
  string out;
  as_math (out, g);
  return out;
}
string as_mmx ( const generic g)

Definition at line 905 of file mmx_printer.cpp.

References print_mmx(), and serialize().

Referenced by flatten_as_mmx(), and output_as_mmx().

                          {
  return serialize (print_mmx (g));
}
generic as_object ( const generic v,
nat  tp_id 
)
generic as_object ( const generic v,
const generic tp 
)

Definition at line 205 of file generic_object.cpp.

                                                {
  return new generic_object_rep (g, get_user_type (tp));
};
static string mmx::as_snippet ( const generic g) [static]

Definition at line 577 of file mmx_texmacs.cpp.

References as_texmacs(), print_mmx(), replace_lf(), and texmacs_to_scheme().

Referenced by flatten_as_tm().

                              {
  string  r= "";
  generic h= print_mmx (g);
  generic m= h;//add_modes (h, 0, 1);
  generic t= as_texmacs (m);
  generic l= replace_lf (t);
  texmacs_to_scheme (r, l);
  return r;
}
string as_string ( unsigned int  i)

Definition at line 102 of file string.cpp.

                           {
  char buffer[100];
  sprintf (buffer, "%u", i);
  return string (buffer);
}
string as_string ( void *  ptr)

Definition at line 88 of file string.cpp.

                      {
  char buffer[100];
  sprintf (buffer, "0x%lx", (unsigned long) ptr);
  return string (buffer);
}
string mmx::as_string ( short int  i) [inline]

Definition at line 122 of file string.hpp.

References as_string().

                                      {
  return as_string ((int) i); }
string mmx::as_string ( short unsigned int  i) [inline]

Definition at line 124 of file string.hpp.

References as_string().

                                               {
  return as_string ((unsigned int) i); }
string mmx::as_string ( signed char  i) [inline]

Definition at line 126 of file string.hpp.

References as_string().

                                        {
  return as_string ((int) i); }
string mmx::as_string ( unsigned char  i) [inline]

Definition at line 128 of file string.hpp.

References as_string().

                                          {
  return as_string ((unsigned int) i); }
string as_string ( long int  i)

Definition at line 109 of file string.cpp.

                       {
  char buffer[100];
  sprintf (buffer, "%ld", i);
  return string (buffer);
}
string as_string ( long unsigned int  i)

Definition at line 116 of file string.cpp.

                                {
  char buffer[100];
  sprintf (buffer, "%lu", i);
  return string (buffer);
}
string as_string ( long long int  i)

Definition at line 123 of file string.cpp.

                            {
  char buffer[100];
  sprintf (buffer, "%lld", i);
  return string (buffer);
}
string as_string ( long long unsigned int  i)

Definition at line 130 of file string.cpp.

                                     {
  char buffer[100];
  sprintf (buffer, "%llu", i);
  return string (buffer);
}
string as_string ( float  x)

Definition at line 153 of file string.cpp.

                    {
  if (x == 0.0) return "0";
  char buffer[32];
  sprintf (buffer, "%1.3e", x);
  return string (buffer);
}
string as_string ( double  x)

Definition at line 163 of file string.cpp.

References as_string_hook.

                     {
  if (as_string_hook != NULL)
    return as_string_hook (x);
  if (x == 0.0) return "0";
  char buffer[32];
  sprintf (buffer, "%1.12g", x);
  return string (buffer);
}
string as_string ( long double  x)

Definition at line 173 of file string.cpp.

                          {
  char buffer[64];
  sprintf (buffer, "%Lf", x);
  return string (buffer);
}
string as_string ( const syntactic g)

Definition at line 26 of file syntactic.cpp.

References literal_to_string().

{ return literal_to_string (*g); }
string mmx::as_string_hexa ( int  i) [inline]

Definition at line 138 of file string.hpp.

Referenced by GLUE_4().

                                     {
  static char buf[16];  
  sprintf (buf, "%x", i);
  return buf; }
generic mmx::as_texmacs ( const generic g)

Definition at line 242 of file mmx_texmacs.cpp.

References cdr(), compound_to_vector(), concat_append(), contains(), ERROR, gen(), GEN_MINUS, GEN_PLUS, is_alpha(), is_func(), literal_to_string(), N(), s, starts(), texmacs_symbol_table(), unbracket(), and vec().

Referenced by as_snippet(), as_texmacs_scheme(), and as_texmacs_snippet().

                              {
  if (is<literal> (g)) {
    if (g == "$lf") return gen ("$lf");
    if (g == "$cr") return gen ("$cr");
    if (g == "$spc") return gen (" ");
    static table<generic,generic> t= texmacs_symbol_table ();
    generic h= g;
    if (contains (t, h)) h= t[h];
    if (!is<literal> (h)) return h;
    string s= literal_to_string (h);
    if (starts (s, "tm$"))
      return generic ("<" * s (3, N(s)) * ">");
    string r;
    for (nat i=0; i<N(s); i++)
      if (s[i] == '<') r << "<less>";
      else if (s[i] == '>') r << "<gtr>";
      else r << s[i];
    return r;
  }
  else if (is_func (g, "$concat")) {
    vector<generic> v;
    for (nat i=1; i<N(g); i++)
      concat_append (v, as_texmacs (g[i]));
    if (N(v) == 0) return generic ("");
    else if (N(v) == 1) return v[0];
    else return gen ("$concat", v);
  }
  else if (is_func (g, "$keyword", 1))
    return as_texmacs (gen ("$strong", g[1]));
  else if (is_func (g, "$keyword", 2))
    return as_texmacs (gen ("$concat", gen ("$strong", g[1]), "$spc", g[2]));
  else if (is_func (g, "$bracket", 3))
    return as_texmacs (gen ("$around*", g[1], g[2], g[3]));
  else if (is_func (g, "$prefix", 2)) {
    if (g[1] == "'" || g[1] == "`")
      return as_texmacs (gen ("$concat", gen ("$lprime", g[1]), g[2]));
    else return as_texmacs (gen ("$concat", g[1], g[2]));
  }
  else if (is_func (g, "$postfix", 2)) {
    if (g[2] == "'" || g[2] == "`")
      return as_texmacs (gen ("$concat", g[1], gen ("$lprime", g[2])));
    else return as_texmacs (gen ("$concat", g[1], g[2]));
  }
  else if (is_func (g, "$infix", 3)) {
    if (g[2] == "/")
      return as_texmacs (gen ("$frac", unbracket (g[1]), unbracket (g[3])));
    else if (g[2] == "^")
      return as_texmacs (gen ("$concat",
                              g[1], gen ("$rsup", unbracket (g[3]))));
    else if (g[2] == "|" || g[2] == "||")
      return as_texmacs (gen ("$concat", g[1], gen ("$mid", g[2]), g[3]));
    else {
      generic op= as_texmacs (g[2]);
      if (is_alpha (op))
        op= gen ("$concat", "$spc", gen ("$strong", op), "$spc");
      return as_texmacs (gen ("$concat", g[1], g[2], g[3]));
    }
  }
  else if (is_func (g, "$bigop") && N(g) >= 3) {
    vector<generic> v;
    if (g[1] == GEN_PLUS && is_func (g[2], GEN_MINUS, 1))
      v << generic ("-") << g[2][1];
    else v << g[2];
    for (nat i=3; i<N(g); i++) {
      if (g[1] == GEN_PLUS && is_func (g[i], GEN_MINUS, 1))
        v << generic ("-") << g[i][1];
      else
        v << g[1] << g[i];
    }
    return as_texmacs (gen ("$concat", v));
  }
  else if (is_func (g, "$operate", 2)) {
    if (is_func (g[2], "$bracket", 3) && g[2][1] == "[")
      return as_texmacs (gen ("$concat",
                              g[1], gen ("$rsub", unbracket (g[2]))));
    else return as_texmacs (gen ("$concat", g[1], g[2]));
  }
  else if (is_func (g, "$hlist")) {
    if (N(g) == 1) return generic ("");
    vector<generic> v= vec (g[1]);
    for (nat i=2; i<N(g); i++) v << generic (",") << g[i];
    return as_texmacs (gen ("$concat", v));
  }
  else if (is_func (g, "$vlist")) {
    vector<generic> v;
    for (nat i=1; i<N(g); i++)
      if (is_func (g[i], "$hlist"))
        v << gen ("$row", cdr (compound_to_vector (g[i])));
    if (N(v) == 0) return generic ("");
    return as_texmacs (gen ("$tabular*", gen ("$table", v)));
  }
  else if (is_func (g, "$indent")) {
    vector<generic> v;
    for (nat i=1; i<N(g); i++)
      concat_append (v, as_texmacs (g[i]));
    return gen ("$concat", gen ("$indent", gen ("$concat", v)), gen ("$lf"));
  }
  else if (is_func (g, "$text", 1))
    return gen ("$text", as_texmacs (g[1]));
  else if (is_func (g, "$math", 1))
    return gen ("$math", as_texmacs (g[1]));
  else if (is_func (g, "$dynamic"))
    return gen ("$locus", gen ("$id", as_texmacs (g[1])), as_texmacs (g[2]));
  else if (is<compound> (g)) {
    vector<generic> v;
    for (nat i=1; i<N(g); i++)
      v << as_texmacs (g[i]);
    return gen (g[0], v);
  }
  else ERROR ("not implemented");
}
string as_texmacs_scheme ( const generic g)

Definition at line 476 of file mmx_texmacs.cpp.

References add_modes(), as_texmacs(), print_mmx(), replace_lf(), and texmacs_to_scheme().

Referenced by flatten_as_texmacs_scheme().

                                     {
  string  r= "(document ";
  generic h= print_mmx (g);
  generic m= add_modes (h, 0, 1);
  generic t= as_texmacs (m);
  generic l= replace_lf (t);
  texmacs_to_scheme (r, l);
  r << ")";
  return r;
}
string as_texmacs_snippet ( const generic g)

Definition at line 465 of file mmx_texmacs.cpp.

References add_modes(), as_texmacs(), print_mmx(), replace_lf(), and texmacs_to_scheme().

Referenced by texmacs_dynamic_event().

                                      {
  string  r= "";
  generic h= print_mmx (g);
  generic m= add_modes (h, 0, 1);
  generic t= as_texmacs (m);
  generic l= replace_lf (t);
  texmacs_to_scheme (r, l);
  return r;
}
vector<T> mmx::as_vector ( const list< T > &  l)

Definition at line 21 of file glue_list_map.cpp.

References car(), cdr(), is_nil(), and N().

                             {
  vector<T> a (fill<T> (N (l)));
  list<T> it= l;
  for (nat i= 0; !is_nil (it); it= cdr (it), i++)
    a[i]= car (it);
  return a;
}
vector<C> mmx::as_vector ( const tuple< C > &  t)

Definition at line 67 of file tuple.hpp.

References N(), and n.

                           {
  nat i, n= N(t);
  vector<C> a= fill<C> (n);
  for (i=0; i<n; i++)
    a[i]= t[i];
  return a;
}
vector<C> mmx::as_vector ( const row_tuple< C > &  t)
generic asin ( const generic x1)

Definition at line 468 of file generic.cpp.

References ACC_ASIN, ACC_UNARY, current_ev, and GEN_ARCSIN.

                         {
  ACC_UNARY (ACC_ASIN, x1);
  return current_ev->apply (GEN_ARCSIN, x1);
}
double asin ( const double &  x) [inline]

Definition at line 55 of file double.hpp.

Referenced by GLUE_41(), asin_op::op(), and asin_op::set_op().

{ return std::asin (x); }
syntactic asin ( const syntactic g)

Definition at line 408 of file syntactic.cpp.

References GEN_ARCSIN, and syn().

{ return syn (GEN_ARCSIN, g); }
vector<C,V> mmx::asin ( const vector< C, V > &  v)

Definition at line 1089 of file vector.hpp.

{ return unary_map<asin_op> (v); }
syntactic asin_init ( const syntactic x,
const syntactic c 
)

Definition at line 469 of file syntactic.cpp.

References syn().

                                                             {
  return syn ("asin_init", x, c); }
generic asin_init ( const generic x,
const generic c 
)

Definition at line 807 of file generic.cpp.

References current_ev.

Referenced by asin_op::op_init().

                                                         {
  return current_ev->apply ("asin_init", x1, x2); }
generic asinh ( const generic x1)

Definition at line 504 of file generic.cpp.

References ACC_ASINH, ACC_UNARY, log(), sqrt(), and square().

                          {
  ACC_UNARY (ACC_ASINH, x1);
  return log (x1 + sqrt (square (x1) + 1));
}
syntactic asinh ( const syntactic g)

Definition at line 414 of file syntactic.cpp.

References GEN_ARGSH, and syn().

{ return syn (GEN_ARGSH, g); }
C mmx::asinh ( const C &  x) [inline]

Definition at line 595 of file defaults.hpp.

References log(), promote(), sqrt(), and square().

Referenced by asinh_op::op(), and asinh_op::set_op().

                                                 {
  return log (x + sqrt (square (x) + promote (1, x))); }
void assign ( const dynamic d,
const generic val 
)

Definition at line 33 of file dynamic.cpp.

References inside(), N(), and val.

Referenced by GLUE_4(), and updater_rep::update().

                                              {
  if (val == d->val) return;
  inside (d) -> val= val;
  for (nat i=0; i<N(d->obs); i++)
    d->obs[i]->modify ();
}
generic atan ( const generic x1)

Definition at line 474 of file generic.cpp.

References ACC_ATAN, ACC_UNARY, current_ev, and GEN_ARCTAN.

                         {
  ACC_UNARY (ACC_ATAN, x1);
  return current_ev->apply (GEN_ARCTAN, x1);
}
double atan ( const double &  x) [inline]

Definition at line 56 of file double.hpp.

Referenced by atan2(), GLUE_42(), atan_op::op(), atan_op::set_op(), and set_pi().

{ return std::atan (x); }
syntactic atan ( const syntactic g)

Definition at line 409 of file syntactic.cpp.

References GEN_ARCTAN, and syn().

{ return syn (GEN_ARCTAN, g); }
vector<C,V> mmx::atan ( const vector< C, V > &  v)

Definition at line 1090 of file vector.hpp.

{ return unary_map<atan_op> (v); }
generic atan2 ( const generic x1,
const generic x2 
)

Definition at line 522 of file generic.cpp.

References abs(), ACC_ATAN2, ACC_BINARY, atan(), and sign().

                                           {
  ACC_BINARY (ACC_ATAN2, x, y);
  if (x > 0) return atan (y/x);
  else if (y == 0)
    return x == 0? generic (0): generic (-4) * atan (generic (1));
  else if (x == 0)
    return generic (2 * sign (y)) * atan (generic (1));
  else return sign (y) * (4 * atan (generic (1)) - atan (abs (y/x)));
}
double atan2 ( const double &  y,
const double &  x 
) [inline]

Definition at line 59 of file double.hpp.

References atan2().

                                                       {
  return std::atan2 (y, x); }
syntactic atan2 ( const syntactic g1,
const syntactic g2 
)

Definition at line 421 of file syntactic.cpp.

References GEN_ARCTAN2, and syn().

                                                           {
  return syn (GEN_ARCTAN2, g1, g2); }
C mmx::atan2 ( const C &  y,
const C &  x 
)

Definition at line 575 of file defaults.hpp.

References abs(), atan(), promote(), and sign().

Referenced by atan2(), atan2_op::op(), and atan2_op::set_op().

                                                      {
  if (x > promote (0, x))
    return atan (y/x);
  else if (y == promote (0, x))
    return x == promote (0, x)?
           promote (0, x): promote (-4, x) * atan (promote (1, x));
  else if (x == promote (0, x))
    return promote (2 * sign (y), x) * atan (promote (1, x));
  else
    return promote (sign (y), x) *
           (promote (4, x) * atan (promote (1, x)) - atan (abs (y/x))); }
syntactic atan_init ( const syntactic x,
const syntactic c 
)

Definition at line 471 of file syntactic.cpp.

References syn().

                                                             {
  return syn ("atan_init", x, c); }
generic atan_init ( const generic x,
const generic c 
)

Definition at line 809 of file generic.cpp.

References current_ev.

Referenced by atan_op::op_init().

                                                         {
  return current_ev->apply ("atan_init", x1, x2); }
generic atanh ( const generic x1)

Definition at line 510 of file generic.cpp.

References ACC_ATANH, ACC_UNARY, and log().

                          {
  ACC_UNARY (ACC_ATANH, x1);
  return log ((1 + x1) / (1 - x1)) / 2;
}
syntactic atanh ( const syntactic g)

Definition at line 415 of file syntactic.cpp.

References GEN_ARGTH, and syn().

{ return syn (GEN_ARGTH, g); }
C mmx::atanh ( const C &  x) [inline]

Definition at line 597 of file defaults.hpp.

References log(), and promote().

Referenced by atanh_op::op(), and atanh_op::set_op().

                                                 {
  return log ((promote (1, x) + x) / (promote (1, x) - x)) / promote (2, x); }
void attach ( const dynamic d,
const observer o 
)

Definition at line 47 of file dynamic.cpp.

References inside().

Referenced by flatten().

                                             {
  inside (d) -> obs << o;
}
void attach_generic_binary_assembler ( const generic tp,
unary_generic  r 
)

Definition at line 72 of file generic.cpp.

References current_ev, gen(), and unary_routine().

Referenced by attach_generic_binary_assembler().

                                                                     {
  if (!is<string> (tp) || as<string> (tp) != "?")
    current_ev->set (gen ("assembler", tp),
                     as<generic> (unary_routine ("binary_assembler", r)));
}
void mmx::attach_generic_binary_assembler ( ) [inline]

Definition at line 267 of file port.hpp.

References attach_generic_binary_assembler().

                                   {
  attach_generic_binary_assembler (binary_helper<T>::full_type_name (),
                                   binary_assemble_generic_via<T>);
}
void attach_generic_binary_reader ( const string s,
unary_generic  r 
)

Definition at line 99 of file generic.cpp.

References binary_readers, s, and unary_routine().

Referenced by attach_generic_binary_reader().

                                                                {
  if (s != "?")
    binary_readers[s]= as<generic> (unary_routine ("binary_reader", r));
}
void mmx::attach_generic_binary_reader ( ) [inline]

Definition at line 282 of file port.hpp.

References attach_generic_binary_reader().

                                {
  attach_generic_binary_reader (binary_helper<T>::short_type_name (),
                                binary_read_generic<T>);
}
string mmx::backtrace ( const generic g)

Definition at line 334 of file source_track.cpp.

References has_trace(), source_exception(), trace_pull(), and trace_top().

Referenced by source_exception().

                             {
  if (has_trace (g))
    return backtrace (trace_pull (g)) * backtrace (trace_top (g));
  else return source_exception (as<exception> (g));
}
chain< C > balance_left ( const chain< C > &  c)

Definition at line 260 of file chain.hpp.

References balance_right(), Chain, is_nil(), left(), middle(), N(), right(), and shift_left().

Referenced by balance_right(), cdr(), and operator*().

                              {
  // Ensure that #left(c) >= #right(c)
  switch (N(c)) {
  case 0:
  case 1:
    return c;
  case 2:
    if (is_nil (right (c))) return c;
    return Chain (Chain (middle (c)), middle (right (c)), Chain ());
  case 3:
    return c;
  default:
    if (N (left (c)) >= N (right (c))) return c;
    else {
      Chain aux= balance_right (right (c));
      return shift_left (Chain (left (c), middle (c), aux));
    }
  }
}
chain< C > balance_right ( const chain< C > &  c)

Definition at line 281 of file chain.hpp.

References balance_left(), Chain, is_nil(), left(), middle(), N(), right(), and shift_right().

Referenced by balance_left(), cDr(), and operator*().

                               {
  // Ensure that #left(c) <= #right(c)
  switch (N(c)) {
  case 0:
  case 1:
    return c;
  case 2:
    if (is_nil (left (c))) return c;
    return Chain (Chain (), middle (left (c)), Chain (middle (c)));
  case 3:
    return c;
  default:
    if (N (left (c)) <= N (right (c))) return c;
    else {
      Chain aux= balance_left (left (c));
      return shift_right (Chain (aux, middle (c), right (c)));
    }
  }
}
C mmx::big ( const table< C, T, V > &  t) [inline]

Definition at line 554 of file table.hpp.

References busy(), C, done(), and entries().

                     {
  iterator<T> it= entries (t);
  if (done (it)) return Op::template neutral<C> ();
  C r= t[*it];
  for (++it; busy (it); ++it)
    Op::set_op (r, t[*it]);
  return r;
}
C mmx::big ( const iterator< C > &  it)

Definition at line 427 of file iterator.hpp.

References busy(), C, CF(), done(), and get_sample().

                         {
  if (done (it)) {
    C r= get_sample (CF (it));
    Op::set_neutral (r);
    return r;
  }
  C r= *it;
  for (++it; busy (it); ++it)
    Op::set_op (r, *it);
  return r;
}
table<C,T,V> table<C,T,V> C mmx::big_add ( const table< C, T, V > &  t) [inline]

Definition at line 690 of file table.hpp.

{ return big<add_op> (t); }
C mmx::big_add ( const iterator< C > &  it) [inline]
Examples:
table_test.cpp, and vector_test.cpp.

Definition at line 439 of file iterator.hpp.

Referenced by GLUE_27().

{ return big<add_op> (it); }
C mmx::big_add ( const vector< C, V > &  v) [inline]

Definition at line 1110 of file vector.hpp.

{ return big<add_op> (v); }
C mmx::big_and ( const table< C, T, V > &  t) [inline]

Definition at line 693 of file table.hpp.

{ return big<and_op> (t); }
C mmx::big_and ( const iterator< C > &  it) [inline]

Definition at line 442 of file iterator.hpp.

{ return big<and_op> (it); }
C mmx::big_and ( const vector< C, V > &  v) [inline]

Definition at line 1113 of file vector.hpp.

{ return big<and_op> (v); }
C mmx::big_inf ( const table< C, T, V > &  t) [inline]

Definition at line 696 of file table.hpp.

{ return big<inf_op> (t); }
C mmx::big_inf ( const vector< C, V > &  v) [inline]

Definition at line 1116 of file vector.hpp.

{ return big<inf_op> (v); }
C mmx::big_max ( const table< C, T, V > &  t) [inline]

Definition at line 695 of file table.hpp.

{ return big<max_op> (t); }
C mmx::big_max ( const iterator< C > &  it) [inline]

Definition at line 444 of file iterator.hpp.

{ return big<max_op> (it); }
C mmx::big_max ( const vector< C, V > &  v) [inline]

Definition at line 1115 of file vector.hpp.

{ return big<max_op> (v); }
C mmx::big_min ( const table< C, T, V > &  t) [inline]

Definition at line 694 of file table.hpp.

{ return big<min_op> (t); }
C mmx::big_min ( const iterator< C > &  it) [inline]
Examples:
vector_test.cpp.

Definition at line 443 of file iterator.hpp.

{ return big<min_op> (it); }
C mmx::big_min ( const vector< C, V > &  v) [inline]

Definition at line 1114 of file vector.hpp.

{ return big<min_op> (v); }
C mmx::big_mul ( const table< C, T, V > &  t) [inline]

Definition at line 691 of file table.hpp.

{ return big<mul_op> (t); }
C mmx::big_mul ( const iterator< C > &  it) [inline]
Examples:
table_test.cpp.

Definition at line 440 of file iterator.hpp.

Referenced by GLUE_26().

{ return big<mul_op> (it); }
C mmx::big_mul ( const vector< C, V > &  v) [inline]

Definition at line 1111 of file vector.hpp.

{ return big<mul_op> (v); }
C mmx::big_or ( const table< C, T, V > &  t) [inline]

Definition at line 692 of file table.hpp.

{ return big< or_op> (t); }
C mmx::big_or ( const iterator< C > &  it) [inline]

Definition at line 441 of file iterator.hpp.

{ return big<or_op > (it); }
C mmx::big_or ( const vector< C, V > &  v) [inline]

Definition at line 1112 of file vector.hpp.

{ return big< or_op> (v); }
int big_small_compare ( const generic g1,
const generic g2 
)

Definition at line 176 of file generic_utils.cpp.

References compare().

Referenced by sum_less_op::op().

                                                         {
  return compare (g1, g2, -1);
}
C mmx::big_sup ( const table< C, T, V > &  t) [inline]

Definition at line 697 of file table.hpp.

{ return big<sup_op> (t); }
C mmx::big_sup ( const vector< C, V > &  v) [inline]

Definition at line 1117 of file vector.hpp.

{ return big<sup_op> (v); }
generic mmx::bigop ( const generic op,
const vector< generic > &  v 
) [inline]

Definition at line 131 of file mmx_printer.cpp.

References cons(), and gen().

                                                                   {
  return gen ("$bigop", cons (op, v)); }
generic mmx::binary_access ( const C &  x,
nat  i 
)

Definition at line 211 of file port.hpp.

References void_binary_helper< C >::access().

                                  {
  return binary_helper<C>::access (x, i);
}
C binary_assemble ( const generic &  x)

Definition at line 221 of file port.hpp.

References void_binary_helper< C >::assemble().

Referenced by binary_helper< compound >::assemble().

                                   {
  return binary_helper<C>::assemble (x);
}
generic binary_assemble_generic ( const generic tp,
const generic val 
)

Definition at line 89 of file generic.cpp.

References ASSERT, current_ev, gen(), mmerr, and val.

Referenced by binary_helper< generic >::assemble().

                                                                {
  if (!current_ev->contains (gen ("assembler", tp)))
    mmerr << "val= " << val << "\n";
  ASSERT (current_ev->contains (gen ("assembler", tp)),
          "unsupported type for generic binary assemble");
  routine r= as<routine> (current_ev->get (gen ("assembler", tp)));
  return r->apply (val);
}
generic mmx::binary_assemble_generic_via ( const generic &  x)

Definition at line 262 of file port.hpp.

                                               {
  return as<generic> (binary_assemble<T> (x));
} 
table<C,T,V> mmx::binary_combine ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
)

Definition at line 564 of file table.hpp.

References busy(), entries(), simplify(), and Table.

                                                {
  Table r (Op::template neutral<C> ());
  for (iterator<T> it1= entries (t); busy (it1); ++it1)
    for (iterator<T> it2= entries (u); busy (it2); ++it2)
      Op::set_op (r[Op::rhs_op::op (*it1, *it2)], t[*it1], u[*it2]);
  simplify (r);
  return r;
}
generic binary_disassemble ( const C &  x)

Definition at line 216 of file port.hpp.

References void_binary_helper< C >::disassemble().

Referenced by generic_concrete_rep< C >::binary_disassemble(), and binary_helper< format< T > >::disassemble().

                                {
  return binary_helper<C>::disassemble (x);
}
generic binary_disassemble_generic ( const generic g)

Definition at line 84 of file generic.cpp.

Referenced by binary_helper< generic >::access().

                                              {
  return g->binary_disassemble ();
}
nat mmx::binary_id ( nat  id1,
nat  id2 
) [inline]

Definition at line 178 of file generic.hpp.

{ return id1 ^ (0x10115 * id2); }
port mmx::binary_ll ( const port &  out,
const C &  x 
)

Definition at line 236 of file port.hpp.

References void_binary_helper< C >::write().

                                        {
  binary_helper<C>::write (out, x);
  return out;
}
sparse_vector<C,T,V> mmx::binary_map ( const sparse_vector< C, T, V > &  v1,
const sparse_vector< C, T, V > &  v2 
)

Definition at line 195 of file sparse_vector.hpp.

References C, n, N(), Pair, and Sparse_vector.

                                                              {
  typedef typename V::val_op Eq;
  typedef typename V::l_op Less;
  nat i1, i2, n1= N(v1), n2= N(v2), j, n= n1 + n2;
  Pair* r= mmx_new<Pair > (n);
  for (i1= i2= j= 0; i1 < n1 && i2 < n2; ) {
    if (Less::op (v1[i1].x1, v2[i2].x1)) {
      Pair e (v1[i1].x1, Op::op (v1[i1].x2, C(0)));
      i1++; if (Eq::not_op (e.x2, C(0))) r[j++]= e;
    }
    else if (Less::op (v2[i2].x1, v1[i1].x1)) {
      Pair e (v2[i2].x1, Op::op (C(0), v2[i2].x2));
      i2++; if (Eq::not_op (e.x2, C(0))) r[j++]= e;
    }
    else {
      Pair e (v2[i2].x1, Op::op (v1[i1].x2, v2[i2].x2));
      i1++; i2++; if (Eq::not_op (e.x2, C (0))) r[j++]= e;
    }
  }
  while (i1 < n1) {
    Pair e (v1[i1].x1, Op::op (v1[i1].x2, C(0)));
    i1++; if (Eq::not_op (e.x2, C(0))) r[j++]= e;
  }
  while (i2 < n2) {
    Pair e (v2[i2].x1, Op::op (C(0), v2[i2].x2));
    i2++; if (Eq::not_op (e.x2, C(0))) r[j++]= e;
  }
  return Sparse_vector (r, j, n);
}
table<C,T,V> mmx::binary_map ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
)

Definition at line 496 of file table.hpp.

References busy(), CF2(), entries(), I(), simplify(), and Table.

                                            {
  Table r (Op::op (I(t), I(u)), CF2(t));
  for (iterator<T> it= entries (t); busy (it); ++it)
    r[*it]= Op::op (t[*it], u[*it]);
  for (iterator<T> it= entries (u); busy (it); ++it)
    if (!(t->contains (*it)))
      r[*it]= Op::op (t[*it], u[*it]);
  simplify (r);
  return r;
}
format<typename binary_return_type_helper< Op , C1 , C2 >::RET > mmx::binary_map ( const format< C1 > &  fm1,
const format< C2 > &  fm2 
)

Definition at line 600 of file type_props.hpp.

References Binary_return_type, and C2.

                                                          {
  typedef Binary_return_type(Op,C1,C2) R;
  typedef typename format<R>::FT FT;
  return format_binary_map_helper<Op,FT,R,C1,C2>::op (fm1, fm2);
}
vector<Binary_return_type(Op,C1,C2),V> mmx::binary_map ( const vector< C1, V > &  v,
const vector< C2, V > &  w 
)

Definition at line 764 of file vector.hpp.

References ASSERT, Binary_return_type, C2, CF(), extend(), is_a_scalar(), is_non_scalar(), N(), n, vector< C, V >::scalar(), seg(), and T.

                                                          {
  typedef implementation<vector_linear,V> Vec;
  typedef Binary_return_type(Op,C1,C2) T;
  format<T> fm= binary_map<Op> (CF(v), CF(w));
  if (is_a_scalar (v) || is_a_scalar (w)) {
    if (is_non_scalar (v)) return binary_map<Op> (v, extend (w, v));
    if (is_non_scalar (w)) return binary_map<Op> (extend (v, w), w);
    return vector<T,V> (Op::op (v.scalar(), w.scalar()));
  }
  nat n= N(v);
  ASSERT (N(w) == n, "lengths don't match");
  nat l= aligned_size<T,V> (n);
  T* r= mmx_formatted_new<T> (l, fm);
  Vec::template vec_binary<Op> (r, seg (v), seg (w), n);
  return vector<T,V> (r, n, l, fm);
}
sparse_vector<C,T,V> mmx::binary_map_optimized ( const sparse_vector< C, T, V > &  v1,
const sparse_vector< C, T, V > &  v2 
)

Definition at line 226 of file sparse_vector.hpp.

References C, n, N(), Pair, and Sparse_vector.

                                                                        {
  // With optimizations for addition and subtraction
  typedef typename V::val_op Eq;
  typedef typename V::l_op Less;
  nat i1, i2, n1= N(v1), n2= N(v2), j, n= n1 + n2;
  Pair* r= mmx_new<Pair > (n);
  for (i1= i2= j= 0; i1 < n1 && i2 < n2; ) {
    if (Less::op (v1[i1].x1, v2[i2].x1)) {
      typedef typename Op::lop Lop;
      r[j++]= Pair (v1[i1].x1, Lop::op (v1[i1].x2)); i1++;
    }
    else if (Less::op (v2[i2].x1, v1[i1].x1)) {
      typedef typename Op::rop Rop;
      r[j++]= Pair (v2[i2].x1, Rop::op (v2[i2].x2)); i2++;
    }
    else {
      Pair e (v2[i2].x1, Op::op (v1[i1].x2, v2[i2].x2));
      i1++; i2++; if (Eq::not_op (e.x2, C (0))) r[j++]= e;
    }
  }
  while (i1 < n1) {
    typedef typename Op::lop Lop;
    r[j++]= Pair (v1[i1].x1, Lop::op (v1[i1].x2)); i1++;
  }
  while (i2 < n2) {
    typedef typename Op::rop Rop;
    r[j++]= Pair (v2[i2].x1, Rop::op (v2[i2].x2)); i2++;
  }
  return Sparse_vector (r, j, n);
}
sparse_vector<C,T,V> mmx::binary_map_scalar ( const sparse_vector< C, T, V > &  v,
const C &  x 
)

Definition at line 279 of file sparse_vector.hpp.

References C, N(), n, Pair, and Sparse_vector.

                                                       {
  typedef typename V::val_op Eq;
  nat i, j, n= N(v);
  Pair* r= mmx_new<Pair > (n);
  for (i=0, j=0; i<n; i++) {
    Pair e (v[i].x1, Op::op (v[i].x2, x));
    if (Eq::not_op (e.x2, C (0))) r[j++]= e;
  }
  return Sparse_vector (r, j, n);
}
table<C,T,V> mmx::binary_map_scalar ( const table< C, T, V > &  t,
const X &  x 
)

Definition at line 508 of file table.hpp.

References busy(), CF2(), entries(), I(), simplify(), and Table.

                                               {
  Table r (Op::op (I(t), x), CF2(t));
  for (iterator<T> it= entries (t); busy (it); ++it)
    r[*it]= Op::op (t[*it], x);
  simplify (r);
  return r;
}
format<typename binary_return_type_helper< Op , C1 , C2 >::RET > mmx::binary_map_scalar ( const format< C1 > &  fm,
const C2 &  x 
)

Definition at line 568 of file type_props.hpp.

References Binary_return_type, and C2.

                                                      {
  typedef Binary_return_type(Op,C1,C2) R;
  typedef typename format<R>::FT FT;
  return format_binary_map_scalar_helper<Op,FT,R,C1,C2>::op (fm, x);
}
vector<Binary_return_type(Op,C,X),V> mmx::binary_map_scalar ( const vector< C, V > &  v,
const X &  x 
)

Definition at line 783 of file vector.hpp.

References Binary_return_type, C, CF(), is_a_scalar(), N(), n, vector< C, V >::scalar(), seg(), and T.

                                                     {
  typedef implementation<vector_linear,V> Vec;
  typedef Binary_return_type(Op,C,X) T;
  format<T> fm= binary_map_scalar<C> (CF(v), x);
  if (is_a_scalar (v)) return vector<T,V> (Op::op (v.scalar(), x));
  nat n= N(v);
  nat l= aligned_size<T,V> (n);
  T* r= mmx_formatted_new<T> (l, fm);
  Vec::template vec_binary_scalar<Op> (r, seg (v), x, n);
  return vector<T,V> (r, n, l, fm);
}
C binary_read ( const port &  in)

Definition at line 231 of file port.hpp.

References void_binary_helper< C >::read().

Referenced by binary_helper< compound >::read().

                             {
  return binary_helper<C>::read (in);
}
generic binary_read_generic ( const port in)

Definition at line 110 of file generic.cpp.

References ASSERT, binary_readers, mmerr, and read().

Referenced by GLUE_28(), and binary_helper< generic >::read().

                                     {
  string name;
  char buf[1];
  while (true) {
    mmx::read (in, buf, 1);
    if (buf[0] == ':') break;
    name << buf[0];
  }
  if (!binary_readers->contains (name))
    mmerr << "name= " << name << "\n";
  ASSERT (binary_readers->contains (name),
          "unsupported type for generic binary read");
  routine r= as<routine> (binary_readers[name]);
  return r->apply (as<generic> (in));
}
generic mmx::binary_read_generic ( const generic &  in)

Definition at line 277 of file port.hpp.

                                        {
  return as<generic> (binary_read<T> (as<port> (in)));
} 
routine mmx::binary_routine ( const generic name,
D(*)(const S1 &, const S2 &)  f 
)

Definition at line 267 of file routine.hpp.

Referenced by accelerate(), define_type_helper< C >::def_type(), define(), and define_user_type().

                                                                    {
  return new binary_routine_rep<D,S1,S2> (name, f);
}
port mmx::binary_rr ( const port &  in,
C &  x 
)

Definition at line 242 of file port.hpp.

References void_binary_helper< C >::read().

                                 {
  x= binary_helper<C>::read (in);
  return in;
}
nat mmx::binary_size ( const C &  x)

Definition at line 206 of file port.hpp.

References void_binary_helper< C >::size().

                         {
  return binary_helper<C>::size (x);
}
bool mmx::binary_test ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
)

Definition at line 536 of file table.hpp.

References busy(), entries(), and I().

                                             {
  if (Op::not_op (I(t), I(u))) return false;
  for (iterator<T> it= entries (t); busy (it); ++it)
    if (Op::not_op (t[*it], u[*it])) return false;
  for (iterator<T> it= entries (u); busy (it); ++it)
    if (!t->contains (*it) && Op::not_op (t[*it], u[*it])) return false;
  return true;
}
bool mmx::binary_test ( const triple< C1, C2, C3 > &  t1,
const triple< C1, C2, C3 > &  t2 
)

Definition at line 54 of file triple.hpp.

                                                 {
  return Op::op (t1.x1,t2.x1) && Op::op(t1.x2, t2.x2) && Op::op(t1.x3, t2.x3);
}
bool mmx::binary_test ( const heap< C > &  h1b,
const heap< C > &  h2b 
)

Definition at line 235 of file heap.hpp.

References copy(), Heap, N(), and pull().

                                               {
  if (N(h1b) != N(h2b)) return false;
  Heap h1= copy (h1b), h2= copy (h2b);
  while (N(h1) > 0)
    if (Op::not_op (pull (h1), pull (h2))) return false;
  return true;
}
bool mmx::binary_test ( const vector< C1, V > &  v,
const vector< C2, V > &  w 
)

Definition at line 835 of file vector.hpp.

References extend(), is_a_scalar(), is_non_scalar(), N(), n, vector< C, V >::scalar(), and seg().

                                                           {
  typedef implementation<vector_linear,V> Vec;
  if (is_a_scalar (v) || is_a_scalar (w)) {
    if (is_non_scalar (v)) return binary_test<Op> (v, extend (w, v));
    if (is_non_scalar (w)) return binary_test<Op> (extend (v, w), w);
    return Op::op (v.scalar(), w.scalar());
  }
  nat n= N(v);
  if (N(w) != n) return false;
  return Vec::template vec_binary_test<Op> (seg (v), seg (w), n);
}
bool mmx::binary_test ( const iterator< C > &  it1b,
const iterator< C > &  it2b 
)

Definition at line 170 of file iterator.hpp.

References ERROR.

                                                         {
  (void) it1b; (void) it2b;
  ERROR ("invalid test on iterators");
  return false;
  /*
  Iterator it1= copy (it1b), it2= copy (it2b);
  while (busy (it1) && busy (it2)) {
    if (Op::not_op (*it1, *it2)) return false;
    ++it1; ++it2;
  }
  return done (it1) && done (it2);
  */
}
bool mmx::binary_test ( const list< C > &  l1,
const list< C > &  l2 
)

Definition at line 221 of file list.hpp.

References is_nil(), read_car(), and read_cdr().

                                             {
  if (is_nil (l1) || is_nil (l2)) return is_nil (l1) && is_nil (l2);
  return Op::op (read_car (l1), read_car (l2)) &&
         binary_test<Op> (read_cdr (l1), read_cdr (l2));
}
bool mmx::binary_test ( const pair< C1, C2 > &  p1,
const pair< C1, C2 > &  p2 
)

Definition at line 49 of file pair.hpp.

                                             {
  return Op::op (p1.x1, p2.x1) && Op::op (p1.x2, p2.x2);
}
bool mmx::binary_test ( const chain< C > &  c1,
const chain< C > &  c2 
)

Definition at line 230 of file chain.hpp.

References left(), middle(), N(), and right().

                                               {
  if (N (c1) != N (c2)) return false;
  if (N (c1) == 0) return true;
  return binary_test<Op> (left (c1), left(c2)) &&
    Op::op (middle (c1), middle (c2)) &&
    binary_test<Op> (right (c1), right(c2));
}
bool mmx::binary_test ( const sparse_vector< C, T, V > &  v1,
const sparse_vector< C, T, V > &  v2 
)

Definition at line 158 of file sparse_vector.hpp.

References N().

                                                               {
  nat n1= N(v1), n2= N(v2);
  if (n1 != n2) return false;
  for (nat i=0; i<n1; i++)
    if (!Op::op (v1[i], v2[i]))
      return false;
  return true;
}
bool mmx::binary_test_scalar ( const table< C, T, V > &  t,
const X &  c 
)

Definition at line 546 of file table.hpp.

References busy(), entries(), and I().

                                                {
  if (Op::not_op (I(t), c)) return false;
  for (iterator<T> it= entries (t); busy (it); ++it)
    if (Op::not_op (t[*it], c)) return false;
  return true;
}
bool mmx::binary_test_scalar ( const vector< C, V > &  v,
const X &  c 
)

Definition at line 848 of file vector.hpp.

References is_a_scalar(), N(), vector< C, V >::scalar(), and seg().

                                                      {
  typedef implementation<vector_linear,V> Vec;
  if (is_a_scalar (v)) return Op::op (v.scalar(), c);
  return Vec::template vec_binary_test_scalar<Op> (seg (v), c, N(v));
}
generic binary_type_generic ( const generic g)

Definition at line 79 of file generic.cpp.

Referenced by binary_helper< generic >::access().

                                       {
  return g->binary_type ();
}
void binary_write ( const port &  out,
const C &  x 
)

Definition at line 226 of file port.hpp.

References void_binary_helper< C >::write().

Referenced by generic_concrete_rep< C >::binary_write().

                                           {
  binary_helper<C>::write (out, x);
}
void binary_write_generic ( const port out,
const generic g 
)

Definition at line 105 of file generic.cpp.

Referenced by GLUE_27(), and binary_helper< generic >::write().

                                                         {
  g->binary_write (out);
}
C mmx::binpow ( const C &  i,
const nat &  n 
)

Definition at line 562 of file defaults.hpp.

References C, promote(), and square().

Referenced by prem_op::op().

                                  {
  // FIXME: how to merge with pow?
  if (n <= 1) return n==0? promote (1, i): i;
  C j= square (binpow (i, n >> 1));
  if ((n&1) == 0) return j;
  else return i * j;
}
static nat mmx::bit_size ( const C &  p) [inline, static]

Return the bitsize of abs (p).

Definition at line 276 of file int.hpp.

References abs(), C, and s.

                      {
  typedef typename unsigned_of_helper<C>::type uC;
  if (p == 0) return 0;
  uC up = abs (p);
  nat s = 0;
  nat k = 4 * sizeof(C);
  uC mask = ((uC) -1) << k;
  while (k != 0) {
    if (up & mask) { up >>= k; s += k; }
    k >>= 1;
    mask >>= k;
  }
  return up == 0 ? s : s + 1;
}
generic blur ( const generic x1,
const generic x2 
)

Definition at line 826 of file generic.cpp.

References current_ev.

                                                    {
  return current_ev->apply ("blur", x1, x2); }
table<C,T,V> mmx::blur ( const table< C, T, V > &  t,
const K &  x 
) [inline]

Definition at line 716 of file table.hpp.

                                                     {
  return binary_map_scalar<blur_op> (t, x); }
vector<C,V> mmx::blur ( const vector< C, V > &  v,
const K &  x 
) [inline]

Definition at line 1168 of file vector.hpp.

                                                       {
  return binary_map_scalar<blur_op> (v, x); }
vector<C,V> mmx::blur ( const vector< C, V > &  v,
const vector< C2, V2 > &  w 
) [inline]

Definition at line 1171 of file vector.hpp.

                                               {
  return binary_map<blur_op> (v, w); }
C mmx::blur ( const C &  x,
const D &  y 
) [inline]

Definition at line 705 of file defaults.hpp.

Referenced by blur_op::op(), and blur_op::set_op().

                                                                        {
  (void) y; return x; }
unary_return_type_helper<abs_op, C >::RET mmx::bnd_down ( const C &  x) [inline]

Definition at line 897 of file type_props.hpp.

{ return as<Abs_type(C) > (x); }
unary_return_type_helper<abs_op, C >::RET mmx::bnd_up ( const C &  x) [inline]

Definition at line 899 of file type_props.hpp.

{ return as<Abs_type(C) > (x); }
generic mmx::bracket ( const generic l,
const generic g,
const generic r 
) [inline]

Definition at line 133 of file mmx_printer.cpp.

References gen().

Referenced by mmx_printer::pp_E0().

                                                                              {
  return gen ("$bracket", l, g, r); }
bool mmx::busy ( const port &  p) [inline]

Definition at line 99 of file port.hpp.

References inside().

                                 {
  return inside (p)->busy (); }
void call_glue ( const string s)

Definition at line 117 of file glue.cpp.

References contains(), ERROR, glue_table, and s.

Referenced by glue_compound(), glue_document(), glue_list_generic(), glue_list_map(), glue_literal(), glue_port(), glue_routine(), glue_string(), glue_table_generic(), glue_vector_generic(), and glue_vector_map().

                                 {
  if (! contains (glue_table (), s))
    ERROR ("Can not find glued function " * s);
  (glue_table () [s]) ();
}
nat mmx::can_read ( const port &  p) [inline]

Definition at line 103 of file port.hpp.

References inside().

Referenced by composite_port_rep::can_read(), GLUE_15(), composite_port_rep::read(), and var_load().

                                    {
  return inside (p)->can_read (); }
nat mmx::can_write ( const port &  p) [inline]

Definition at line 101 of file port.hpp.

References inside().

Referenced by composite_port_rep::can_write(), and GLUE_14().

                                     {
  return inside (p)->can_write (); }
string mmx::canonical_name ( const string name)

Definition at line 167 of file system.cpp.

References ends(), get_directory(), and N().

Referenced by path_name(), relative_name(), and resolve_name().

                                    {
  for (int i= N(name)-1; i>=0; i--)
    if (name[i] == '/') {
      nat j=i;
      while (j>0 && name[j-1] == '/') j--;
      string pre = canonical_name (name (0, j));
      string post= name (i+1, N(name));
      if (pre == "") return "/" * post;
      else if (pre == ".") return post;
      else if (post == ".") return pre;
      else if (ends (pre, "..") && post == "..") return pre * "/" * post;
      else if (post == "..") return get_directory (pre);
      else return pre * "/" * post;
    }
  return name;
}
C mmx::car ( const vector< C, V > &  v) [inline]

Definition at line 605 of file vector.hpp.

{ return v[0]; }
const C & car ( const list< C > &  l) [inline]

Return the head of l.

Definition at line 140 of file list.hpp.

{ return l.rep->item; }
C & car ( list< C > &  l) [inline]

Return the head of l.

Return a copy of car (l) for write access.

Definition at line 144 of file list.hpp.

{ l.secure(); return l.rep->item; }
generic mmx::cAr ( const vector< generic > &  a) [inline]

Definition at line 129 of file cpp_printer.cpp.

References N().

                               {
  if (N(a) == 0)
    return generic ();
  return a[N(a)-1];
}
C mmx::cAr ( const chain< C > &  c)
Examples:
chain_test.cpp.

Definition at line 214 of file chain.hpp.

References ASSERT, is_nil(), middle(), and right().

Referenced by operator*().

                     {
  ASSERT (!is_nil (c), "non-empty chain expected");
  if (is_nil (right (c))) return middle (c);
  return cAr (right (c));
}
generic car ( const generic g)

Definition at line 46 of file generic_utils.cpp.

                       {
  return g[0];
}
C mmx::catalan_cst ( ) [inline]

Definition at line 741 of file type_props.hpp.

References C, and set_catalan().

{ C r; set_catalan (r); return r; }
chain<C> mmx::cDr ( const chain< C > &  c)
Examples:
chain_test.cpp.

Definition at line 310 of file chain.hpp.

References ASSERT, balance_right(), Chain, is_nil(), left(), middle(), N(), and right().

Referenced by operator*().

                     {
  ASSERT (!is_nil (c), "non-empty chain expected");
  if (N (c) == 1) return Chain ();
  if (2 * N (right (c)) <= N (left (c))) return cDr (balance_right (c));
  return Chain (left (c), middle (c), cDr (right (c)));
}
vector<C,V> mmx::cdr ( const vector< C, V > &  v) [inline]

Definition at line 606 of file vector.hpp.

References N(), and range().

{ return range (v, 1, N(v)); }
list< C > & cdr ( list< C > &  l) [inline]

Return the tail of l.

Return a copy of cdr (l) for write access.

Definition at line 149 of file list.hpp.

{ l.secure(); return l.rep->next; }
const list< C > & cdr ( const list< C > &  l) [inline]

Return the tail of l.

Definition at line 145 of file list.hpp.

{ return l.rep->next; }
vector<generic> mmx::cDr ( const vector< generic > &  a) [inline]

Definition at line 136 of file cpp_printer.cpp.

References N(), and range().

                               {
  if (N(a) == 0)
    return a;
  return range (a,0,N(a)-1);
}
generic cdr ( const generic g)

Definition at line 51 of file generic_utils.cpp.

References compound_to_vector(), N(), range(), and vector_to_compound().

                       {
  return vector_to_compound (range (compound_to_vector (g), 1, N(g)));
}
double ceil ( const double &  x) [inline]

Definition at line 127 of file double.hpp.

Referenced by ceil_op::op(), and ceil_op::set_op().

{ return std::ceil (x); }
generic ceil ( const generic x)

Definition at line 752 of file generic.cpp.

References current_ev, and GEN_CEIL.

                                {
  return current_ev->apply (GEN_CEIL, x); }
syntactic center ( const syntactic g1)

Definition at line 434 of file syntactic.cpp.

References GEN_CENTER, and syn().

{ return syn (GEN_CENTER, g1); }
generic center ( const generic x1)

Definition at line 820 of file generic.cpp.

References current_ev.

Referenced by center_op::Center_type(), and center_op::set_op().

                                   {
  return current_ev->apply ("center", x1); }  
C mmx::center ( const C &  x) [inline]

Definition at line 889 of file type_props.hpp.

{ return x; }
vector<Center_type(C),V> mmx::center ( const vector< C, V > &  v)

Definition at line 1158 of file vector.hpp.

                                            {
  return unary_map<center_op> (v); }
format<C> mmx::CF ( const vector< C, V > &  v) [inline]

Definition at line 203 of file vector.hpp.

{ return v->tfm (); }
format<C> mmx::CF1 ( const table< C, T, V > &  t) [inline]

Definition at line 159 of file table.hpp.

{ return t.coefficient1_format (); }
format<C1> mmx::CF1 ( const triple< C1, C2, C3 > &  t) [inline]

Definition at line 43 of file triple.hpp.

References get_format().

{ return get_format (t.x1); }
format<C1> mmx::CF1 ( const pair< C1, C2 > &  p) [inline]

Definition at line 39 of file pair.hpp.

References get_format().

{ return get_format (p.x1); }
format<T> mmx::CF2 ( const table< C, T, V > &  t) [inline]

Definition at line 160 of file table.hpp.

{ return t.coefficient2_format (); }
format<C2> mmx::CF2 ( const triple< C1, C2, C3 > &  t) [inline]

Definition at line 44 of file triple.hpp.

References get_format().

{ return get_format (t.x2); }
format<C2> mmx::CF2 ( const pair< C1, C2 > &  p) [inline]
format<C3> mmx::CF3 ( const triple< C1, C2, C3 > &  t) [inline]

Definition at line 45 of file triple.hpp.

References get_format().

{ return get_format (t.x3); }
generic change_precision ( const generic x,
xnat  p 
)

Definition at line 761 of file generic.cpp.

References current_ev, and GEN_CHANGE_PRECISION.

Referenced by change_precision_op::op(), and change_precision_op::set_op().

                                                    {
  return current_ev->apply (GEN_CHANGE_PRECISION, x, as<generic> ((int) p)); }
vector<C,V> mmx::change_precision ( const vector< C, V > &  v,
xnat  p 
) [inline]

Definition at line 1139 of file vector.hpp.

                                                              {
  return binary_map_scalar<change_precision_op> (v, p); }
routine change_signature ( const routine r,
const vector< nat > &  sig 
)

Definition at line 201 of file routine.cpp.

Referenced by define_user_type().

                                                            {
  return new change_signature_routine_rep (r, sig);
}
void mmx::clear ( C &  x) [inline]

Definition at line 236 of file defaults.hpp.

References promote().

Referenced by clear_op::set_op().

{ x= promote (0, x); }
void mmx::close_alias ( const alias< C > &  a) [inline]

Definition at line 58 of file alias.hpp.

Referenced by alias_binary_access_rep< C, R, A, B >::close(), and alias_unary_access_rep< C, R, A >::close().

{ a->close (); }
static void mmx::collect ( vector< generic > &  v,
const generic g,
nat  depth 
) [static]

Definition at line 733 of file mmx_printer.cpp.

References gen(), GEN_MINUS, GEN_PLUS, and is_func().

Referenced by collect().

                                                          {
  if (depth >= 16384) v << g;
  else if (is_func (g, GEN_PLUS, 2)) {
    collect (v, g[1], depth+1);
    collect (v, g[2], depth+1);
  }
  else if (is_func (g, GEN_MINUS, 2)) {
    collect (v, g[1], depth+1);
    v << gen (GEN_MINUS, g[2]);
  }
  else v << g;
}
static vector<generic> mmx::collect ( const generic g) [static]

Definition at line 747 of file mmx_printer.cpp.

References collect(), GEN_MINUS, GEN_PLUS, is_func(), and N().

                           {
  vector<generic> v;
  collect (v, g, 0);
  vector<generic> w;
  for (nat i=0; i<N(v); i++)
    if (is_func (v[i], GEN_PLUS, 2) || is_func (v[i], GEN_MINUS, 2))
      w << collect (v[i]);
    else w << v[i];
  return w;
}
generic comma ( )
Examples:
generic_test.cpp.

Definition at line 169 of file generic.cpp.

References gen(), and GEN_COMMA.

Referenced by trig_op::op(), trig(), and xaccess().

                 {
  return gen (generic (GEN_COMMA)); }
generic comma ( const generic x1,
const generic x2 
)

Definition at line 171 of file generic.cpp.

References gen(), and GEN_COMMA.

                                                     {
  return gen (GEN_COMMA, g1, g2); }
table<C,T,V> mmx::common ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
)

Definition at line 735 of file table.hpp.

References busy(), CF2(), entries(), I(), and Table.

                                        {
  Table r (I (t), CF2(t));
  for (iterator<T> it= entries (t); busy (it); ++it)
    if (V::val_op::op (u[*it], t[*it]))
      r[*it]= t[*it];
  return r;
}
C mmx::common_part ( const C &  x,
const C &  y 
) [inline]

Definition at line 731 of file defaults.hpp.

References promote().

Referenced by common_part_op::op().

                                     {
  if (x == y) return x;
  else return promote (0, x);
}
int mmx::compare ( const C &  x,
const C &  y 
) [inline]

Definition at line 485 of file defaults.hpp.

References sign().

Referenced by big_small_compare(), compare_sub(), and small_big_compare().

                                 {
  return sign (x-y);
}
static int compare ( const generic g1,
const generic g2,
const int &  dir 
) [static]

Definition at line 162 of file generic_utils.cpp.

References compare_N(), compare_P(), and MEMOIZE_BINARY.

                                                               {
  // NOTE: the splitting into two cases should not be necessary.
  // We do it in order to avoid an internal compiler error...
  if (dir < 0) {
    MEMOIZE_BINARY (std_memoizer,int,generic,generic,compare_N,g1,g2,
                   compare_N (g1, g2));
  }
  else {
    MEMOIZE_BINARY (std_memoizer,int,generic,generic,compare_P,g1,g2,
                   compare_P (g1, g2));
  }
}
mmx::COMPARE_INT_SUGAR ( template< typename C, typename V >  ,
vector< C, V >   
)
int mmx::compare_N ( const generic g1,
const generic g2 
)

Definition at line 156 of file generic_utils.cpp.

References compare_sub().

Referenced by compare().

                                                     {
  return compare_sub (g1, g2, -1); }
static int mmx::compare_numeric ( const string s1,
const string s2 
) [static]

Definition at line 112 of file generic_utils.cpp.

References N().

Referenced by compare_sub().

                                                     {
  if (s1[0] == '-' && s2[0] != '-') return -1;
  if (s1[0] != '-' && s2[0] == '-') return 1;
  if (s1[0] == '-' && s2[0] == '-')
    return -compare_numeric (s1 (1, N (s1)), s2 (1, N(s2)));
  if (N(s1) < N(s2)) return -1;
  if (N(s1) > N(s2)) return 1;
  if (s1 < s2) return -1;
  if (s1 > s2) return 1;
  return 0;
}
int mmx::compare_P ( const generic g1,
const generic g2 
)

Definition at line 158 of file generic_utils.cpp.

References compare_sub().

Referenced by compare().

                                                     {
  return compare_sub (g1, g2, 1); }
static int mmx::compare_sub ( const generic g1,
const generic g2,
const int &  direction 
) [static]

Definition at line 127 of file generic_utils.cpp.

References compare(), compare_numeric(), is_numeric(), literal_to_string(), N(), size(), and var_flatten().

Referenced by compare_N(), and compare_P().

                                                                         {
  nat s1= size (g1), s2= size (g2);
  if (s1 < s2) return -direction;
  if (s1 > s2) return direction;
  if (is<literal> (g1) && is<literal> (g2)) {
    string l1= literal_to_string (g1), l2= literal_to_string (g2);
    if (is_numeric (l1) && !is_numeric (l2)) return -direction;
    if (is_numeric (l2) && !is_numeric (l1)) return direction;
    if (is_numeric (l1) && is_numeric (l2))
      return direction * compare_numeric (l1, l2);
    if (l1 < l2) return -1;
    if (l1 > l2) return 1;
    return 0;
  }
  if (is<literal> (g1) && is<compound> (g2)) return -direction;
  if (is<compound> (g1) && is<literal> (g2)) return direction;
  if (is<compound> (g1) && is<compound> (g2)) {
    nat i, n1= N (g1), n2= N (g2);
    if (n1 < n2) return -direction;
    if (n1 > n2) return direction;
    for (i=0; i<n1; i++) {
      int c= compare (g1[i], g2[i], direction);
      if (c != 0) return c;
    }
    return 0;
  }
  return compare (var_flatten (g1), var_flatten (g2), direction);
}
port component ( const port &  p,
const string &  name 
)

Definition at line 106 of file port.cpp.

References inside().

Referenced by GLUE_21().

                                                   {
  return inside (p)->component (name); }
vector< syntactic > components ( const syntactic g)

Definition at line 86 of file syntactic.cpp.

References N().

Referenced by arguments().

                                {
  vector<syntactic> v= fill<syntactic> (N(g));
  for (nat i=0; i<N(g); i++) v[i]= g[i];
  return v;
}
generic compose ( const generic x1,
const generic x2 
)

Definition at line 697 of file generic.cpp.

References current_ev, and GEN_COMPOSE.

Referenced by compose(), reverse_op::diff_op(), compose_op::diff_op(), compose_op::op(), and compose_op::set_op().

                                                       {
  return current_ev->apply (GEN_COMPOSE, x1, x2); }
routine compose ( const routine fun,
const vector< routine > &  args 
)

Definition at line 166 of file routine.cpp.

References exact_eq(), exact_neq(), GEN_IDENTITY, and N().

                                                          {
  // WARNING: the signature of the result is not necessarily correct
  // when simplifying with "fake identity functions", but that does not
  // matter for the application to overloading
  if (exact_eq (fun->name, GEN_IDENTITY) && N(args) == 1)
    return args [0];
  for (nat i=0; i<N(args); i++) {
    if (exact_neq (args[i]->name, GEN_IDENTITY))
      return new composed_routine_rep (fun, args);
  }
  return fun;
}
routine mmx::compose ( const routine fun,
const routine arg 
) [inline]

Definition at line 441 of file routine.hpp.

References compose(), and vec().

                                                                {
  return compose (fun, vec (arg)); }
port composite_port ( const vector< port > &  ps)

Definition at line 135 of file composite_port.cpp.

References as_string(), N(), and n.

Referenced by GLUE_7(), and pipe_port().

                                        {
  nat i, n= N(ps);
  vector<string> names= fill<string> (n);
  for (i=0; i<n; i++) names[i]= as_string (i);
  return composite_port (ps, names);
}
port composite_port ( const vector< port > &  ps,
const vector< string > &  names 
)

Definition at line 129 of file composite_port.cpp.

References ASSERT, and N().

                                                                     {
  ASSERT (N(ps) == N(names), "lengths do not match");
  return (port_rep*) new composite_port_rep (ps, names);
}
generic mmx::concat ( const vector< generic > &  v) [inline]

Definition at line 116 of file mmx_printer.cpp.

References gen().

Referenced by print_mmx().

                                                 {
  return gen ("$concat", v); }
generic mmx::concat ( ) [inline]

Definition at line 118 of file mmx_printer.cpp.

References gen().

                         {
  return gen ("$concat"); }
generic mmx::concat ( const generic g1,
const generic g2 
) [inline]

Definition at line 120 of file mmx_printer.cpp.

References gen().

                                                             {
  return gen ("$concat", g1, g2); }
generic mmx::concat ( const generic g1,
const generic g2,
const generic g3,
const generic g4 
) [inline]

Definition at line 125 of file mmx_printer.cpp.

References gen().

                                                             {
  return gen ("$concat", g1, g2, g3, g4); }
generic mmx::concat ( const generic g1,
const generic g2,
const generic g3 
) [inline]

Definition at line 122 of file mmx_printer.cpp.

References gen().

                                          {
  return gen ("$concat", g1, g2, g3); }
void mmx::concat_append ( vector< generic > &  v,
const generic g 
)

Definition at line 221 of file mmx_texmacs.cpp.

References compound_to_vector(), gen(), is_func(), literal_to_string(), and N().

Referenced by as_texmacs().

                                                     {
  if (g == "");
  else if (is_func (g, "$concat")) {
    vector<generic> w= compound_to_vector (g);
    for (nat i=1; i<N(w); i++) concat_append (v, w[i]);
  }
  else if (N(v) == 0) v << g;
  else if (is<literal> (v[N(v)-1]) && is<literal> (g))
    v[N(v)-1]= generic (literal_to_string (v[N(v)-1]) * literal_to_string (g));
  else if (is_func (v[N(v)-1], "$lprime", 1) && is_func (g, "$lprime", 1)) {
    generic p (literal_to_string (v[N(v)-1][1]) * literal_to_string (g[1]));
    v[N(v)-1]= gen ("$lprime", p);
  }
  else if (is_func (v[N(v)-1], "$rprime", 1) && is_func (g, "$rprime", 1)) {
    generic p (literal_to_string (v[N(v)-1][1]) * literal_to_string (g[1]));
    v[N(v)-1]= gen ("$rprime", p);
  }
  else v << g;
}
generic mmx::concrete_vector ( const vector< generic > &  abst,
const generic conc 
) [inline]

Definition at line 288 of file vector.hpp.

                                                                   {
  return conc->make_concrete_vector (as<generic> (abst));
}
syntactic conj ( const syntactic g1)

Definition at line 428 of file syntactic.cpp.

References GEN_CONJ, and syn().

{ return syn (GEN_CONJ, g1); }
generic conj ( const generic x1)

Definition at line 737 of file generic.cpp.

References current_ev, and GEN_CONJ.

                                 {
  return current_ev->apply (GEN_CONJ, x1); }
vector<C,V> mmx::conj ( const vector< C, V > &  v)

Definition at line 1156 of file vector.hpp.

{ return unary_map<conj_op> (v); }
C mmx::conj ( const C &  x) [inline]

Definition at line 714 of file defaults.hpp.

Referenced by conj_op::op(), and conj_op::set_op().

{ return x; }
vector<C,V> mmx::cons ( const C &  c,
const vector< C, V > &  v 
)

Definition at line 634 of file vector.hpp.

References ASSERT, C, CF(), copy(), is_non_scalar(), N(), n, seg(), and Vector.

                                   {
  typedef implementation<vector_linear,V> Vec;
  ASSERT (is_non_scalar (v), "non-scalar vector expected");
  nat n= N(v);
  nat l= aligned_size<C,V> (n+1);
  C* a= mmx_formatted_new<C> (l, CF(v));
  a[0]= c;
  Vec::copy (a+1, seg (v), n);
  return Vector (a, n+1, l, CF(v));
}
list< C > cons ( const C &  c,
const list< C > &  l 
) [inline]

Return a new list with head and tail l.

Definition at line 139 of file list.hpp.

References List.

{ return List (c, l); }
generic cons ( const generic g1,
const generic g2,
const generic g3 
)

Definition at line 40 of file generic_utils.cpp.

References append(), compound_to_vector(), and vector_to_compound().

                                                               {
  return vector_to_compound (append (vec<generic> (g1, g2),
                                     compound_to_vector (g3)));
}
generic construct ( const int &  i)

Definition at line 194 of file generic.cpp.

References current_ev.

Referenced by generic_concrete_rep< C >::acc_construct(), as_generic(), and accelerator< C >::set_construct().

                         {
  return current_ev->construct (as<generic> (i));
}
generic construct ( const nat i)

Definition at line 199 of file generic.cpp.

References current_ev.

                         {
  return current_ev->construct (as<generic> ((int) i));
}
generic construct ( const double &  x)

Definition at line 204 of file generic.cpp.

References current_ev.

                            {
  return current_ev->construct (as<generic> (x));
}
generic construct ( const generic x)

Definition at line 214 of file generic.cpp.

References current_ev.

                             {
  return current_ev->construct (x);
}
generic construct ( const float &  x)

Definition at line 209 of file generic.cpp.

References current_ev.

                           {
  return current_ev->construct (as<generic> ((double) x));
}
bool mmx::contains ( const table< C, T, V > &  t,
const T &  x 
) [inline]

Definition at line 177 of file table.hpp.

                                                       {
  return t->contains (x); }
bool mmx::contains ( const table< C, T, V > &  t,
const K &  x 
) [inline]

Definition at line 166 of file table.hpp.

                                                        {
  return t->contains (as<T> (x)); }
bool mmx::contains ( const vector< C, V > &  v,
const C &  x 
)

Definition at line 697 of file vector.hpp.

References find(), and N().

                                       {
  return find (v, x) < ((int) N(v));
}
bool mmx::contains ( const list< C > &  l,
const C &  x 
)

Definition at line 326 of file list.hpp.

References car(), cdr(), and is_nil().

Referenced by as_texmacs(), call_glue(), dl_link(), GLUE_10(), GLUE_17(), GLUE_18(), GLUE_19(), GLUE_5(), insert(), new_type_id(), REP_STRUCT_2(), serialize(), and source_locate().

                                     {
  if (is_nil (l)) return false;
  else return car (l) == x || contains<C> (cdr (l), x);
}
generic mmx::contents ( const dynamic d) [inline]

Definition at line 90 of file dynamic.hpp.

References inside(), and val.

Referenced by GLUE_2().

{ return inside (d) -> val; }
generic convert ( const generic from,
const generic to 
)

Definition at line 285 of file generic.cpp.

References current_ev, GEN_CONVERT, is_nil(), same_type(), and type_name().

                                                 {
  if (same_type (from, to)) return from;
  routine* cv= to->acc_construct (from->acc_id ());
  if (cv != NULL && !is_nil (*cv)) return (*cv) (from);
  return current_ev->apply (GEN_CONVERT, from, type_name (to));
}
string mmx::copy ( const string s)

Definition at line 333 of file string.cpp.

References n, and N().

                       {
  register nat i, n= N(s);
  string r (n);
  for (i=0; i<n; i++) r.rep->a[i]= s.rep->a[i];
  return r;
}
char mmx::copy ( char  c) [inline]

Definition at line 219 of file defaults.hpp.

{ return c; }
signed char mmx::copy ( signed char  c) [inline]

Definition at line 220 of file defaults.hpp.

{ return c; }
unsigned char mmx::copy ( unsigned char  c) [inline]

Definition at line 221 of file defaults.hpp.

{ return c; }
short int mmx::copy ( short int  c) [inline]

Definition at line 222 of file defaults.hpp.

{ return c; }
short unsigned int mmx::copy ( short unsigned int  c) [inline]

Definition at line 223 of file defaults.hpp.

{ return c; }
int mmx::copy ( int  c) [inline]

Definition at line 224 of file defaults.hpp.

{ return c; }
long int mmx::copy ( long int  c) [inline]

Definition at line 226 of file defaults.hpp.

{ return c; }
unsigned int mmx::copy ( unsigned int  c) [inline]

Definition at line 225 of file defaults.hpp.

{ return c; }
long unsigned int mmx::copy ( long unsigned int  c) [inline]

Definition at line 227 of file defaults.hpp.

{ return c; }
long long unsigned int mmx::copy ( long long unsigned int  c) [inline]

Definition at line 229 of file defaults.hpp.

{ return c; }
table<C,T,V> mmx::copy ( const table< C, T, V > &  t)

Definition at line 479 of file table.hpp.

References busy(), CF2(), entries(), I(), and Table.

                      {
  Table r (I(t), CF2(t));
  for (iterator<T> it= entries (t); busy (it); ++it)
    r[*it]= t[*it];
  return r;
}
float mmx::copy ( float  c) [inline]

Definition at line 231 of file defaults.hpp.

{ return c; }
long long int mmx::copy ( long long int  c) [inline]

Definition at line 228 of file defaults.hpp.

{ return c; }
double mmx::copy ( double  c) [inline]

Definition at line 232 of file defaults.hpp.

{ return c; }
void* mmx::copy ( C *  p) [inline]

Definition at line 234 of file defaults.hpp.

{ return p; }
heap< C > heap< C > copy ( const heap< C > &  h)

Definition at line 247 of file heap.hpp.

References C, and Heap.

                     {
  C* b= mmx_new<C> (h->l);
  for (nat i=0; i<h->n; i++) b[i]= h->a[i];
  return Heap (b, h->n, h->l, h->compare);
}
vector<C,V> mmx::copy ( const vector< C, V > &  v)

Definition at line 970 of file vector.hpp.

                                   {
  return unary_map<id_op> (v); }
iterator< C > copy ( const iterator< C > &  it) [inline]

Definition at line 100 of file iterator.hpp.

{ return it.rep->clone (); }
list<C> mmx::copy ( const list< C > &  l)

Definition at line 275 of file list.hpp.

References car(), cdr(), cons(), and is_nil().

                     {
  if (is_nil (l)) return l;
  return cons (car (l), cdr (l));
}
chain<C> mmx::copy ( const chain< C > &  c)

Definition at line 195 of file chain.hpp.

References Chain, is_nil(), left(), middle(), and right().

                      {
  if (is_nil (c)) return c;
  return Chain (left (c), middle (c), right (c));
}
generic cos ( const generic x1)

Definition at line 444 of file generic.cpp.

References ACC_COS, ACC_UNARY, current_ev, and GEN_COS.

                        {
  ACC_UNARY (ACC_COS, x1);
  return current_ev->apply (GEN_COS, x1);
}
double cos ( const double &  x) [inline]
syntactic cos ( const syntactic g)

Definition at line 404 of file syntactic.cpp.

References GEN_COS, and syn().

{ return syn (GEN_COS, g); }
vector<C,V> mmx::cos ( const vector< C, V > &  v)

Definition at line 1085 of file vector.hpp.

{ return unary_map<cos_op> (v); }
vector<C> mmx::cos_sin ( const C &  x)

Definition at line 1218 of file vector.hpp.

References cos(), sin(), and vec().

Referenced by tan_op::def(), sin_op::def(), and cos_op::def().

                                                    {
  return vec (cos (x), sin (x)); }
double cosh ( const double &  x) [inline]

Definition at line 51 of file double.hpp.

References cosh().

{ return std::cosh (x); }
generic cosh ( const generic x1)

Definition at line 480 of file generic.cpp.

References ACC_COSH, ACC_UNARY, and exp().

                         {
  ACC_UNARY (ACC_COSH, x1);
  return (exp (x1) + exp (-x1)) / 2;
}
syntactic cosh ( const syntactic g)

Definition at line 410 of file syntactic.cpp.

References GEN_CH, and syn().

{ return syn (GEN_CH, g); }
C mmx::cosh ( const C &  x) [inline]

Definition at line 587 of file defaults.hpp.

References exp(), and promote().

Referenced by cosh(), tanh_op::diff_op(), sinh_op::diff_op(), cosh_op::op(), cosh_op::op_init(), and cosh_op::set_op().

                                                {
  return (exp (x) + exp (-x)) / promote (2, x); }
generic mmx::CPP_ACCESS ( "."  [])
generic mmx::CPP_AND ( "and"  )
generic mmx::CPP_APPLY ( ".()"  )
generic mmx::CPP_ARROW ( "->"  )
generic mmx::CPP_BEGIN ( "begin"  )
generic mmx::CPP_BREAK ( "break"  )
generic mmx::CPP_CAST ( ":  ,
 
)
generic mmx::CPP_CATCH ( "catch"  )
generic mmx::CPP_CONST ( "const"  )
generic mmx::CPP_CONSTRUCT ( "construct"  )
generic mmx::CPP_CONSTRUCTOR ( "constructor"  )
generic mmx::CPP_CONTINUE ( "continue"  )
generic mmx::CPP_DEFINE ( )
generic mmx::CPP_DELETE ( "delete"  )
string cpp_demangle ( const char *  name)

Definition at line 312 of file cpp_printer.cpp.

References first(), and mmerr.

                                      {
  static bool first= true;
  if (first) {
    mmerr << "Warning: C++ name unmangling is not available\n";
    first= false;
  }
  return string (name);
}
generic mmx::CPP_DESTRUCTOR ( "destructor"  )
generic mmx::CPP_DO ( "do"  )
generic mmx::CPP_DOT ( "."  )
generic mmx::CPP_ELSE ( "else"  )
generic mmx::CPP_EXIT ( "exit"  )
generic mmx::CPP_EXTERN ( "extern"  )
generic mmx::CPP_FOR ( "for"  )
generic mmx::CPP_GTR ( ,
 
)
generic mmx::CPP_GTREQ ( ">="  )
generic mmx::CPP_GTRGTREQ ( )

Referenced by opname_table().

generic mmx::CPP_IF ( "if"  )
generic mmx::CPP_INHERIT ( "inherit"  )
generic mmx::CPP_INITIALIZE ( "initialize"  )
generic mmx::CPP_INLINE ( "inline"  )
generic mmx::CPP_LESSLESSEQ ( )

Referenced by opname_table().

generic mmx::CPP_MOD ( "%"  )
generic mmx::CPP_NAMESPACE ( "namespace"  )
generic mmx::CPP_NEW ( "new"  )
generic mmx::CPP_NOT ( "!"  )
generic mmx::CPP_OR ( "or"  )
generic mmx::CPP_PREDEC ( "--."  )
generic mmx::CPP_PREINC ( "++."  )
generic mmx::CPP_PUBLIC ( "public"  )
generic mmx::CPP_RETURN ( "return"  )
generic mmx::CPP_SCOPE ( "::"  )
generic mmx::CPP_SPECIALIZE ( "specialize"  )
generic mmx::CPP_STATIC ( "static"  )
generic mmx::CPP_STRUCT ( "struct"  )
generic mmx::CPP_SWITCH ( "switch"  )
generic mmx::CPP_TEMPLATE ( "template"  )
generic mmx::CPP_THROW ( "raise"  )
generic mmx::CPP_TRY ( "try"  )
generic mmx::CPP_TYPEDEF ( "typedef"  )
generic mmx::CPP_UNALIAS ( "unalias"  )
generic mmx::CPP_UNFUNCTION ( "unfunction"  )
generic mmx::CPP_UNPOINTER ( "unpointer"  )
generic mmx::CPP_USING ( "using"  )
generic mmx::CPP_VERBATIM ( "verbatim"  )
generic mmx::CPP_VIRTUAL ( "virtual"  )
generic mmx::CPP_WHILE ( "while"  )
generic mmx::CPP_XOR ( "^^"  )
double decexp2 ( const double &  x,
const S &  y 
) [inline]

Definition at line 107 of file double.hpp.

{ return ldexp (x, -y); }
double decexp2 ( const double &  x) [inline]

Definition at line 109 of file double.hpp.

{ return ldexp (x, -1); }
void decexp2 ( double &  x,
const double &  y,
const S &  z 
) [inline]

Definition at line 113 of file double.hpp.

{ x= ldexp (y, -z); }
generic decexp2 ( const generic x1,
const xint x2 
)

Definition at line 790 of file generic.cpp.

References current_ev.

                                                    {
  return current_ev->apply ("decrease_exponent", x1, as<generic> ((int) x2)); }
C mmx::decexp2 ( const C &  x) [inline]

Definition at line 403 of file defaults.hpp.

{ return decexp2<C,xint> (x, 1); }
void mmx::decexp2 ( C &  x,
const C &  y,
const S &  z 
) [inline]

Definition at line 407 of file defaults.hpp.

{ x= y >> z; }
C mmx::decexp2 ( const C &  x,
const S &  y 
) [inline]

Definition at line 401 of file defaults.hpp.

Referenced by GLUE_44(), decexp2_op::op(), decexp2_op::set_op(), and make_interval_helper< B, C >::val().

{ return x >> y; }
void decexp2_assign ( double &  x,
const S &  y 
) [inline]

Definition at line 111 of file double.hpp.

{ x= ldexp (x, -y); }
void mmx::decexp2_assign ( C &  x,
const S &  y 
) [inline]

Definition at line 405 of file defaults.hpp.

Referenced by decexp2_op::set_op().

{ x >>= y; }
string decode_name ( const string name)

Definition at line 141 of file system.cpp.

References get_env(), N(), and starts().

Referenced by file_exists(), follow_link(), input_file_port(), input_output_file_port(), load(), load_directory(), mkdir(), output_file_port(), and save().

                                 {
  if (name == "~") return get_env ("HOME");
  if (starts (name, "~/")) return get_env ("HOME") * "/" * name (2, N(name));
  if (starts (name, "$")) {
    nat i;
    for (i=0; i<N(name); i++)
      if (name[i] == '/') break;
    string r= get_env (name (1, i));
    if (i == N(name)) return r;
    return r * "/" * name (i+1, N(name));
  }
  return name;
}
nat mmx::default_aligned_size ( nat  n) [inline]

Definition at line 76 of file vector_naive.hpp.

References n, and V.

                             {
  typedef typename vector_variant_helper<C>::VV V;
  typedef implementation<vector_allocate,V> Vec;
  return aligned_size<C,V> (n);
}
routine default_routine ( const generic name)

Definition at line 218 of file routine.cpp.

References as(), get_alias(), and is().

Referenced by list_apply(), list_map(), list_sort(), vector_apply(), vector_map(), and vector_sort_leq().

                                      {
  if (is<routine> (name))
    return as<routine> (name);
  if (is<alias<routine> > (name))
    return get_alias (as<alias<routine> > (name));
  return new default_routine_rep (name);
}
void mmx::define ( const generic name,
D(*)(const S1 &)  fun 
) [inline]

Definition at line 190 of file glue.hpp.

References accelerate(), current_ev, and unary_routine().

                                                   {
  current_ev->overload (name, as<generic> (unary_routine (name, fun)));
  accelerate (name, fun);
}
void mmx::define ( const generic name,
D(*)(const S1 &, const S2 &)  fun 
) [inline]

Definition at line 196 of file glue.hpp.

References accelerate(), binary_routine(), and current_ev.

                                                              {
  current_ev->overload (name, as<generic> (binary_routine (name, fun)));
  accelerate (name, fun);
}
void mmx::define ( const generic name,
D(*)(const S1 &, const S2 &, const S3 &, const S4 &)  fun 
) [inline]

Definition at line 209 of file glue.hpp.

References current_ev, and quaternary_routine().

                                                   {
  current_ev->overload (name, as<generic> (quaternary_routine (name, fun)));
}
void mmx::define ( const generic name,
D(*)(const S1 &, const S2 &, const S3 &, const S4 &, const S5 &)  fun 
) [inline]

Definition at line 217 of file glue.hpp.

References current_ev, and quintary_routine().

                                                              {
  current_ev->overload (name, as<generic> (quintary_routine (name, fun)));
}
void mmx::define ( const generic name,
D(*)(const S1 &, const S2 &, const S3 &)  fun 
) [inline]

Definition at line 203 of file glue.hpp.

References current_ev, and ternary_routine().

                                                                         {
  current_ev->overload (name, as<generic> (ternary_routine (name, fun)));
}
mmx::DEFINE_BINARY_FORMAT_2 ( pair  )
void mmx::define_constant ( const generic name,
const D &  x 
) [inline]

Definition at line 170 of file glue.hpp.

References current_ev.

                                                  {
  current_ev->set (name, as<generic> (x));
}
void mmx::define_constructor ( generic(*)(const D &)  fun) [inline]

Definition at line 175 of file glue.hpp.

References current_ev, GEN_NEW, and unary_routine().

                                               {
  current_ev->overload (GEN_NEW, as<generic> (unary_routine (GEN_NEW, fun)));
}
void mmx::define_converter ( const generic name,
C(*)(const S1 &)  f,
nat  p 
) [inline]

Definition at line 223 of file glue.hpp.

References accelerate_converter(), current_ev, gen(), GEN_INTO, and unary_routine().

Referenced by glue_document(), glue_double(), glue_list_generic(), glue_routine(), glue_table_generic(), and glue_vector_generic().

                                                                  {
  generic con= gen (GEN_INTO, type_name<S1> (), type_name<C> ());
  routine fun= unary_routine (con, f);
  current_ev->overload (name, as<generic> (fun), p);
  accelerate_converter (name, f);
}
void define_prerequisites ( )

Definition at line 39 of file glue.cpp.

References fall_back_equal(), fall_back_unequal(), GEN_BOOLEAN_TYPE, GEN_COMPOUND_TYPE, GEN_DOUBLE_TYPE, GEN_EQUAL, GEN_FALSE, GEN_GENERIC_TYPE, GEN_INT_TYPE, GEN_LITERAL_TYPE, GEN_MACRO_TYPE, GEN_ROUTINE_TYPE, GEN_TRUE, and GEN_UNEQUAL.

                        {
  define_type<generic> (GEN_GENERIC_TYPE);
  define_type<bool> (GEN_BOOLEAN_TYPE);
  define_type<int> (GEN_INT_TYPE);
  define_type<double> (GEN_DOUBLE_TYPE);
  define_type<literal> (GEN_LITERAL_TYPE);
  define_type<compound> (GEN_COMPOUND_TYPE);
  define_type<routine> (GEN_ROUTINE_TYPE);
  define_type<primitive> (GEN_MACRO_TYPE);
  define_constant<bool> (GEN_FALSE, false);
  define_constant<bool> (GEN_TRUE, true);
  define<bool,generic,generic> (GEN_EQUAL, fall_back_equal);
  define<bool,generic,generic> (GEN_UNEQUAL, fall_back_unequal);
}
void mmx::define_primitive ( const generic name,
generic(*)(const generic &)  fun 
) [inline]

Definition at line 180 of file glue.hpp.

References current_ev.

                                                                        {
  current_ev->set (name, as<generic> (primitive (name, fun)));
}
mmx::DEFINE_TERNARY_FORMAT_3 ( triple  )
void mmx::define_type ( const generic name) [inline]
void define_type_sub ( const generic name,
nat  id 
)

Definition at line 67 of file glue.cpp.

References all_type_names(), current_ev, gen(), GEN_ALL_TYPES, GEN_TYPE_ID, GEN_TYPE_NAME, is_alias_type(), and is_tuple_type().

Referenced by define_type_helper< C >::def_type(), and define_user_type().

                                              {
  current_ev->set (gen (GEN_TYPE_NAME, as<generic> (id)), name);
  current_ev->set (gen (GEN_TYPE_ID, name), as<generic> (id));
  if (!is_tuple_type (id) && !is_alias_type (id)) {
    vector<generic> all_types= all_type_names ();
    all_types << name;
    current_ev->set (gen (GEN_ALL_TYPES), as<generic> (all_types));
  }
}
mmx::DEFINE_UNARY_FORMAT_1 ( chain  ) const

Definition at line 91 of file chain.hpp.

References Format.

                                       {
  return (Format) l; }
mmx::DEFINE_UNARY_FORMAT_1 ( list  ) const

Definition at line 100 of file list.hpp.

References Format.

                                      {
  return (Format) l; }
nat define_user_type ( const generic name)

Definition at line 104 of file generic_object.cpp.

References alias_getter(), alias_setter(), alias_specializer(), binary_routine(), change_signature(), current_ev, define_type_sub(), gen(), GEN_ALIAS, GEN_ALIAS_TYPE, GEN_EQUAL, GEN_FLATTEN, GEN_GENERIC_TYPE, GEN_INTO, GEN_REWRITE, GEN_SPECIALIZE, GEN_UNALIAS, GEN_UNEQUAL, new_alias_type_id(), new_type_id(), object_alias(), object_equal(), object_flatten(), object_generalize_alias(), object_get_alias(), object_set_alias(), object_specialize_alias(), object_unequal(), PENALTY_INCLUSION, and unary_routine().

Referenced by get_user_type().

                                       {
  nat id= new_type_id ();
  nat alias_id= new_alias_type_id (id);
  // nat tuple_id= new_tuple_type_id (id);
  define_type_sub (name, id);
  define_type_sub (gen (GEN_ALIAS_TYPE, name), alias_id);
  // define_type_sub (gen (GEN_TUPLE_TYPE, name), tuple_id);

  {
    vector<nat> sig= vec<nat> (alias_id, id);
    routine r = unary_routine (GEN_ALIAS, object_alias);
    routine r2= change_signature (r, sig);
    current_ev->overload (GEN_ALIAS, as<generic> (r2), PENALTY_INCLUSION);
  }

  {
    vector<nat> sig= vec<nat> (id, alias_id);
    routine r = unary_routine (GEN_UNALIAS, object_get_alias);
    routine r2= change_signature (r, sig);
    alias_getter (alias_id, r2);  
  }

  {
    vector<nat> sig= vec<nat> (id, alias_id, id);
    routine r = binary_routine (GEN_UNALIAS, object_set_alias);
    routine r2= change_signature (r, sig);
    alias_setter (alias_id, r2);  
  }

  {
    vector<nat> sig= vec<nat> (alias_id, type_id<alias<generic> > ());
    routine r = unary_routine (GEN_SPECIALIZE, object_specialize_alias);
    routine r2= change_signature (r, sig);
    alias_specializer (id, r2);
  }

  {
    vector<nat> sig= vec<nat> (id, alias_id);
    generic cv= gen (GEN_INTO, name, gen (GEN_ALIAS_TYPE, name));
    routine r = unary_routine (cv, object_get_alias);
    routine r2= change_signature (r, sig);
    current_ev->overload (GEN_REWRITE, as<generic> (r2), PENALTY_INCLUSION);
  }

  {
    vector<nat> sig= vec<nat> (type_id<alias<generic> > (), alias_id);
    generic cv= gen (GEN_INTO, gen (GEN_ALIAS_TYPE, GEN_GENERIC_TYPE),
                               gen (GEN_ALIAS_TYPE, name));
    routine r = unary_routine (cv, object_generalize_alias);
    routine r2= change_signature (r, sig);
    current_ev->overload (GEN_REWRITE, as<generic> (r2), PENALTY_INCLUSION);
  }

  {
    vector<nat> sig= vec<nat> (type_id<bool> (), id, id);
    routine r = binary_routine (GEN_EQUAL, object_equal);
    routine r2= change_signature (r, sig);
    current_ev->overload (GEN_EQUAL, as<generic> (r2), PENALTY_INCLUSION);
  }

  {
    vector<nat> sig= vec<nat> (type_id<bool> (), id, id);
    routine r = binary_routine (GEN_UNEQUAL, object_unequal);
    routine r2= change_signature (r, sig);
    current_ev->overload (GEN_UNEQUAL, as<generic> (r2), PENALTY_INCLUSION);
  }

  {
    vector<nat> sig= vec<nat> (type_id<syntactic> (), id);
    routine r = unary_routine (GEN_FLATTEN, object_flatten);
    routine r2= change_signature (r, sig);
    current_ev->overload (GEN_FLATTEN, as<generic> (r2), PENALTY_INCLUSION);
  }

  return id;
}
generic denominator ( const generic x)

Definition at line 714 of file generic.cpp.

References current_ev, and GEN_DENOMINATOR.

Referenced by denominator_op::Denominator_type(), denominator_op::op(), and denominator_op::set_op().

                                       {
  return current_ev->apply (GEN_DENOMINATOR, x); }
syntactic denominator ( const syntactic x)

Definition at line 438 of file syntactic.cpp.

References GEN_DENOMINATOR, and syn().

                                            {
  return syn (GEN_DENOMINATOR, g1); }
generic derive ( const generic x1)

Definition at line 669 of file generic.cpp.

References ACC_DERIVE, ACC_UNARY, current_ev, and GEN_CACHED_DERIVE.

                           {
  ACC_UNARY (ACC_DERIVE, x1);
  return current_ev->apply (GEN_CACHED_DERIVE, x1);
}
generic derive ( const generic x1,
const generic x2 
)

Definition at line 681 of file generic.cpp.

References ACC_BINARY_SCALAR, ACC_DERIVE_WRT, current_ev, derive(), GEN_CACHED_DERIVE, and MEMOIZE_BINARY.

                                             {
  ACC_BINARY_SCALAR (ACC_DERIVE_WRT, x1, v);
  MEMOIZE_BINARY (std_memoizer,generic,generic,generic,derive,x1,v,
                  current_ev->apply (GEN_CACHED_DERIVE, x1, v));
}
syntactic derive ( const syntactic g)

Definition at line 450 of file syntactic.cpp.

References GEN_DERIVE, and syn().

                                      {
  return syn (GEN_DERIVE, g); }
syntactic derive ( const syntactic g,
const syntactic v 
)

Definition at line 452 of file syntactic.cpp.

References GEN_DERIVE, and syn().

                                                          {
  return syn (GEN_DERIVE, g, v); }
vector<C,V> mmx::derive ( const vector< C, V > &  v)

Definition at line 1099 of file vector.hpp.

                                     {
  return unary_map<derive_op> (v); }
vector<C,V> mmx::derive ( const vector< C, V > &  v,
const X &  x 
)

Definition at line 1104 of file vector.hpp.

                                     {
  return binary_map_scalar<derive_op> (v, x); }
void destroy ( const updater u)

Definition at line 208 of file dynamic.cpp.

References detach(), inside(), and N().

Referenced by result_observer_rep::destroy(), INDIRECT_IMPL(), and dynamic_rep::~dynamic_rep().

                           {
  for (nat i=0; i<N(u->obs); i++) detach (u->obs[i]);
  inside (u) -> args = vector<dynamic> ();
  inside (u) -> obs  = vector<observer> ();
}
void mmx::detach ( const observer o)

Definition at line 52 of file dynamic.cpp.

References append(), ERROR, hard_eq(), N(), and range().

Referenced by destroy().

                           {
  vector<observer>& obs= o->ref->obs;
  for (nat i=0; i<N(obs); i++)
    if (hard_eq (obs[i], o)) {
      obs= append (range (obs, 0, i), range (obs, i+1, N(obs)));
      return;
    }
  ERROR ("observer not attached");
}
table<C,T,V> mmx::difference ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
)

Definition at line 744 of file table.hpp.

References busy(), CF2(), entries(), I(), and Table.

                                            {
  Table r (I (t), CF2(t));
  for (iterator<T> it= entries (t); busy (it); ++it)
    if (!V::val_op::op (u[*it], t[*it]))
      r[*it]= t[*it];
  return r;
}
generic dilate ( const generic x1,
const generic x2 
)

Definition at line 699 of file generic.cpp.

References current_ev.

                                                      {
  return current_ev->apply ("dilate", x1, x2); }
void mmx::div ( R &  x,
const C1 &  y1,
const C2 &  y2 
) [inline]

Definition at line 58 of file operators.hpp.

Referenced by ldiv_op::set_op(), rdiv_op::set_op(), and div_op::set_op().

{ x= y1 / y2; }
T mmx::div_operator ( const T &  x,
const T &  y 
)

Definition at line 32 of file operators.hpp.

{ return x/y; }
bool mmx::divides ( const signed char &  n,
const signed char &  m 
) [inline]

Definition at line 431 of file int.hpp.

Referenced by GLUE_13().

{
bool mmx::divides ( const short int &  n,
const short int &  m 
) [inline]

Definition at line 432 of file int.hpp.

{
bool mmx::divides ( const int &  n,
const int &  m 
) [inline]

Definition at line 433 of file int.hpp.

{
bool mmx::divides ( const long int &  n,
const long int &  m 
) [inline]

Definition at line 434 of file int.hpp.

{
bool mmx::divides ( const long long int &  n,
const long long int &  m 
) [inline]

Definition at line 435 of file int.hpp.

{
bool mmx::divides ( const unsigned char &  n,
const unsigned char &  m 
) [inline]

Definition at line 436 of file int.hpp.

{
bool mmx::divides ( const unsigned short int &  n,
const unsigned short int &  m 
) [inline]

Definition at line 437 of file int.hpp.

{
bool mmx::divides ( const unsigned int &  n,
const unsigned int &  m 
) [inline]

Definition at line 438 of file int.hpp.

{
bool mmx::divides ( const unsigned long long int &  n,
const unsigned long long int &  m 
) [inline]

Definition at line 440 of file int.hpp.

{
bool mmx::divides ( const unsigned long int &  n,
const unsigned long int &  m 
) [inline]

Definition at line 439 of file int.hpp.

{
bool dl_exists ( const string name)

Definition at line 57 of file dlink.cpp.

References dl_find().

                               {
#ifdef BASIX_ENABLE_EMBEDDED
  (void) name;
  return true;
#else
  return dl_find (name) != "";
#endif
}
static string mmx::dl_find ( const string name) [static]

Definition at line 38 of file dlink.cpp.

References path_name(), and prefix_dir().

Referenced by dl_exists(), and dl_link().

                             {
  string lib;
  string pdir = prefix_dir () * "/lib";
  lib= path_name ("$LTDL_LIBRARY_PATH:$LD_LIBRARY_PATH:$DYLD_LIBRARY_PATH:"
                  * pdir, "libmmx" * name * ".la");
  if (lib != "") return lib;
  lib= path_name ("$LTDL_LIBRARY_PATH:$LD_LIBRARY_PATH:$MMX_LOAD_PATH:"
                  * pdir, "libmmx" * name * ".so");
  if (lib != "") return lib;
  lib= path_name ("$LTDL_LIBRARY_PATH:$DYLD_LIBRARY_PATH:$MMX_LOAD_PATH:"
                  * pdir, "libmmx" * name * ".dylib");
  if (lib != "") return lib;
  lib= path_name ("$LD_LIBRARY_PATH:$MMX_LOAD_PATH:"
                  * pdir, "libmmx" * name * ".dll");
  if (lib != "") return lib;
  return "";
}
void dl_link ( const string name,
const string init 
)

Definition at line 69 of file dlink.cpp.

References as_charp(), contains(), dl_find(), done(), embedded_link, ERROR, error_message(), and free_charp().

Referenced by dl_link().

                                                 {
#ifdef BASIX_ENABLE_EMBEDDED
  if (embedded_link != NULL)
    embedded_link (name);
#else
  static table<bool,string> done (false);
  if (contains (done, name)) return;

  //mmout << "Linking " << name << "\n";
  string lib= dl_find (name);
  if (lib == "") ERROR ("library " * name * " not in library path");
  if (lt_dlinit () != 0) ERROR ("lt_dlinit failed for " * name);

  //mmout << "Opening " << lib << "\n";
  char* _lib = as_charp (lib);
  lt_dlhandle handle= lt_dlopen (_lib);
  free_charp (_lib);
  if (handle == NULL) {
    //mmerr << lt_dlerror () << lf; 
    throw mmx::error_message (string (lt_dlerror ()));
  }

  //mmout << "Searching " << init << "\n";
  char* _init= as_charp (init);
  lt_ptr ptr = lt_dlsym (handle, _init);
  free_charp (_init);
  if (ptr == NULL) {
    //mmerr << lt_dlerror () << lf;
    throw mmx::error_message (string (lt_dlerror ()));
  }

  //mmout << "Initializing " << name << "\n";
  void (**define_glue) (void)= (void (**) (void)) ptr;
  (*define_glue) ();

  done[name]= true;
#endif
}
void dl_link ( const string name)

Definition at line 109 of file dlink.cpp.

References dl_link().

                             {
  dl_link (name, "define_" * name);
}
string dl_option ( )

Definition at line 29 of file dlink.cpp.

             {
#ifdef __APPLE__ // also to be used for BSD system
  return " -dynamiclib";
#else
  return " -shared";
#endif
}
string dl_suffix ( )

Definition at line 20 of file dlink.cpp.

             {
#ifdef __APPLE__ // also to be used for BSD system
  return "dylib";
#else
  return "so";
#endif
}
generic mmx::documentify ( const string s)

Definition at line 18 of file document.cpp.

References gen(), N(), and tokenize().

                              {
  vector<string> v= tokenize (s, "\n");
  if (N(v) == 0) return gen ("$concat");
  if (N(v) == 1) return generic (v[0]);
  vector<generic> r= vec<generic> (v[0]);
  for (nat i=1; i<N(v); i++) r << generic ("$lf") << generic (v[i]);
  return gen ("$concat", r);
}
C mmx::dot ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1211 of file vector.hpp.

References ASSERT, CF(), is_non_scalar(), N(), and seg().

Referenced by GLUE_25().

                                              {
  typedef implementation<vector_linear,V> Vec;
  ASSERT (is_non_scalar (v) && is_non_scalar (w),
          "non-scalar vectors expected");
  ASSERT (N(v) == N(w), "lengths don't match");
  return Vec::inn_prod (seg (v), seg (w), N(v), CF (v)); }
string string mmx::duplicate ( const string &  s) [inline]

Definition at line 108 of file string.hpp.

References copy().

{ return copy (s); }
table<C,T,V> mmx::duplicate ( const table< C, T, V > &  t) [inline]

Definition at line 603 of file table.hpp.

                                             {
  return unary_map<duplicate_op,C,T,V> (t); }
C mmx::duplicate ( const C &  x) [inline]
vector<C,V> mmx::duplicate ( const vector< C, V > &  v)

Definition at line 972 of file vector.hpp.

                                        {
  return unary_map<duplicate_op> (v); }
generic mmx::duplicate ( const generic x1)

Definition at line 131 of file generic.cpp.

                              {
  return x1->duplicate_me ();
}
generic elementary_error ( const generic x)

Definition at line 777 of file generic.cpp.

References current_ev, and GEN_ELEMENTARY_ERROR.

Referenced by elementary_error_op::Abs_type(), GLUE_48(), and elementary_error_op::set_op().

                                            {
  return current_ev->apply (GEN_ELEMENTARY_ERROR, x); }
unary_return_type_helper<abs_op, C >::RET mmx::elementary_error ( const C &  x) [inline]

Definition at line 872 of file type_props.hpp.

References rounding_error().

                                                                      {
  return rounding_error (x); }
bool ends ( const string s,
const string what 
)

Tell if s ends with what.

Definition at line 320 of file string.cpp.

References N(), and s.

Referenced by canonical_name(), GLUE_11(), scheme_to_tm(), unquote(), and write().

                                           {
  return N(s) >= N(what) && s (N(s) - N(what), N(s)) == what;
}
void* mmx::enlarge_malloc ( register size_t  sz)
mmx::EQUAL_INT_SUGAR ( template< typename C, typename V >  ,
vector< C, V >   
)
bool mmx::equal_operator ( const T &  x,
const T &  y 
)

Definition at line 34 of file operators.hpp.

{ return x==y; }
bool mmx::error_flag ( const port &  p) [inline]

Definition at line 96 of file port.hpp.

References inside().

Referenced by composite_port_rep::error_flag(), composite_port_rep::error_message(), GLUE_11(), save(), and var_load().

                                       {
  return inside (p)->error_flag (); }
exception mmx::error_message ( const char *  msg) [final]

Definition at line 44 of file basix.cpp.

References exception.

                                {
  return exception (msg, generic ("C++ code"));
}
exception mmx::error_message ( const string msg) [final]

Definition at line 49 of file basix.cpp.

References exception.

                                  {
  return exception (msg, generic ("C++ code"));
}
string error_message ( const port &  p)

Definition at line 104 of file port.cpp.

References inside().

Referenced by dl_link(), composite_port_rep::error_message(), and GLUE_12().

                                     {
  return inside (p)->error_message (); }
port error_port ( const string &  message)

Definition at line 127 of file port.cpp.

Referenced by socket_port_rep::accept(), GLUE_8(), input_file_port(), input_output_file_port(), output_file_port(), socket_client_port(), and socket_server_port().

                             {
  return (port_rep*) new error_port_rep (s);
}
string escape ( const string s)

Replace "\n", "\t", and "\b" respectively by "\\n", "\\t", and "\\b".

Definition at line 449 of file string.cpp.

References n, and N().

Referenced by quote().

                         {
  int i, n= N(s);
  string r;
  for (i=0; i<n; i++)
    if ((s[i] == '\\') || (s[i] == '\"')) r << '\\' << s[i];
    else if (s[i] == '\b') r << "\\b";
    else if (s[i] == '\t') r << "\\t";
    else if (s[i] == '\n') r << "\\n";
    else if (s[i] == '\r') r << "\\r";
    else r << s[i];
  return r;
}
C mmx::euler_cst ( ) [inline]

Definition at line 739 of file type_props.hpp.

References C, and set_euler().

{ C r; set_euler (r); return r; }
generic eval ( const generic x)

Definition at line 219 of file generic.cpp.

References current_ev.

Referenced by include(), and rebuild().

                        {
  return current_ev->eval (x);
}
string eval_system ( const string s)

Definition at line 124 of file system.cpp.

References init_system(), N(), system(), user_dir(), and var_load().

Referenced by prefix_dir().

                              {
  init_system ();
  string temp= user_dir () * "/tmp/eval_system";
  system (s * " > " * temp);
  string r;
  bool flag= var_load (temp, r);
  system ("rm -rf " * temp);
  if (flag) return "";
  while ((N(r)>0) && (r[N(r)-1] == '\n')) r= r (0, N(r)-1);
  return r;
}
bool mmx::exact_eq ( short int  c1,
short int  c2 
) [inline]

Definition at line 109 of file defaults.hpp.

{ return c1 == c2; }
bool mmx::exact_eq ( unsigned char  c1,
unsigned char  c2 
) [inline]

Definition at line 108 of file defaults.hpp.

{ return c1 == c2; }
bool mmx::exact_eq ( short unsigned int  c1,
short unsigned int  c2 
) [inline]

Definition at line 110 of file defaults.hpp.

                                                                    {
  return c1 == c2; }
bool mmx::exact_eq ( int  c1,
int  c2 
) [inline]

Definition at line 112 of file defaults.hpp.

{ return c1 == c2; }
bool mmx::exact_eq ( unsigned int  c1,
unsigned int  c2 
) [inline]

Definition at line 113 of file defaults.hpp.

{ return c1 == c2; }
bool mmx::exact_eq ( long int  c1,
long int  c2 
) [inline]

Definition at line 114 of file defaults.hpp.

{ return c1 == c2; }
bool mmx::exact_eq ( long unsigned int  c1,
long unsigned int  c2 
) [inline]

Definition at line 115 of file defaults.hpp.

                                                                  {
  return c1 == c2; }
bool mmx::exact_eq ( long long int  c1,
long long int  c2 
) [inline]

Definition at line 117 of file defaults.hpp.

{ return c1 == c2; }
bool exact_eq ( const symbol< C, V > &  s1,
const symbol< C, V > &  s2 
) [inline]

Definition at line 108 of file symbol.hpp.

                                                               {
  return s1.rep == s2.rep; }
bool mmx::exact_eq ( float  x,
float  y 
) [inline]

Definition at line 121 of file defaults.hpp.

{ return x == y; }
bool mmx::exact_eq ( double  x,
double  y 
) [inline]

Definition at line 122 of file defaults.hpp.

{ return x == y; }
bool mmx::exact_eq ( const syntactic &  c1,
const syntactic &  c2 
) [inline]

Definition at line 58 of file syntactic.hpp.

References exact_eq().

                                                                {
  return exact_eq (*c1, *c2); }
bool mmx::exact_eq ( long long unsigned int  c1,
long long unsigned int  c2 
) [inline]

Definition at line 118 of file defaults.hpp.

                                                                            {
  return c1 == c2; }
bool mmx::exact_eq ( C *  p1,
C *  p2 
) [inline]

Definition at line 123 of file defaults.hpp.

{ return p1 == p2; }
bool exact_eq ( const generic x1,
const generic x2 
)

Definition at line 585 of file generic.cpp.

References is_nil(), and same_type().

                                                {
  if (same_type (x1, x2))
    return x1->is_exact_eq (x2);
  else {
    routine* cv= x1->acc_construct (x2->acc_id ());
    if (cv != NULL && !is_nil (*cv))
      return x1 -> is_exact_eq ((*cv) (x2));
    cv= x2->acc_construct (x1->acc_id ());
    if (cv != NULL && !is_nil (*cv))
      return (*cv) (x1) -> is_exact_eq (x2);
  }
  return false;
}
bool exact_eq ( const int &  x1,
const generic x2 
)

Definition at line 614 of file generic.cpp.

References exact_eq().

                                                 {
  return exact_eq (x2, x1); }
bool exact_eq ( const generic x1,
const int &  x2 
)

Definition at line 600 of file generic.cpp.

References is_nil().

                                            {
  if (is<int> (x1)) return as<int> (x1) == x2;
  else {
    routine* cv= x1->acc_construct (accelerator<int>::id);
    if (cv != NULL && !is_nil (*cv))
      return x1 -> is_exact_eq ((*cv) (as<generic> (x2)));
  }
  return false;
}
bool mmx::exact_eq ( const document c1,
const document c2 
) [inline]

Definition at line 55 of file document.hpp.

References exact_eq().

                                                              {
  return exact_eq (*c1, *c2); }
bool mmx::exact_eq ( const exception &  e1,
const exception &  e2 
) [inline]

Definition at line 43 of file exception.hpp.

References exact_eq().

                                                                {
  return exact_eq (*e1, *e2); }
bool mmx::exact_eq ( const literal c1,
const literal c2 
) [inline]

Definition at line 48 of file literal.hpp.

References exact_eq().

                                                            {
  return exact_eq (as_symbol (c1), as_symbol (c2)); }
bool mmx::exact_eq ( char  c1,
char  c2 
) [inline]

Definition at line 106 of file defaults.hpp.

{ return c1 == c2; }
bool mmx::exact_eq ( signed char  c1,
signed char  c2 
) [inline]

Definition at line 107 of file defaults.hpp.

{ return c1 == c2; }
nat exact_hash ( const symbol< C, V > &  s) [inline]

Definition at line 106 of file symbol.hpp.

References as_hash().

                                             {
  return as_hash (s.rep); }
nat mmx::exact_hash ( const syntactic &  c) [inline]

Definition at line 52 of file syntactic.hpp.

References exact_hash().

{ return exact_hash (*c); }
nat mmx::exact_hash ( const document c) [inline]

Definition at line 49 of file document.hpp.

References exact_hash().

{ return exact_hash (*c); }
nat mmx::exact_hash ( const exception &  e) [inline]

Definition at line 37 of file exception.hpp.

References exact_hash().

{ return exact_hash (*e); }
nat mmx::exact_hash ( const iterator< C > &  it) [inline]
nat mmx::exact_hash ( const literal c) [inline]

Definition at line 42 of file literal.hpp.

References exact_hash().

{ return exact_hash (as_symbol (c)); }
nat mmx::exact_hash ( char  c) [inline]

Definition at line 84 of file defaults.hpp.

{ return (nat) c; }
nat mmx::exact_hash ( signed char  c) [inline]

Definition at line 85 of file defaults.hpp.

{ return (nat) c; }
nat mmx::exact_hash ( unsigned char  c) [inline]

Definition at line 86 of file defaults.hpp.

{ return (nat) c; }
nat mmx::exact_hash ( const generic &  g) [inline]

Definition at line 160 of file generic.hpp.

                                         {
  return g->get_exact_hash_value (); }
nat mmx::exact_hash ( short int  c) [inline]

Definition at line 87 of file defaults.hpp.

{ return (nat) c; }
nat mmx::exact_hash ( short unsigned int  c) [inline]

Definition at line 88 of file defaults.hpp.

{ return (nat) c; }
nat mmx::exact_hash ( int  c) [inline]

Definition at line 89 of file defaults.hpp.

{ return (nat) c; }
nat mmx::exact_hash ( unsigned int  c) [inline]

Definition at line 90 of file defaults.hpp.

{ return (nat) c; }
nat mmx::exact_hash ( long int  c) [inline]

Definition at line 91 of file defaults.hpp.

{ return (nat) c; }
nat mmx::exact_hash ( long long int  c) [inline]

Definition at line 93 of file defaults.hpp.

                                        {
  nat h = (nat) ((c >> (4 * sizeof (long int))) >> (4 * sizeof (long int)));
  return (h<<1) ^ (h<<5) ^ (h>>27) ^ ((nat) c); }
nat mmx::exact_hash ( long unsigned int  c) [inline]

Definition at line 92 of file defaults.hpp.

{ return (nat) c; }
nat mmx::exact_hash ( long long unsigned int  c) [inline]

Definition at line 96 of file defaults.hpp.

                                                 {
  nat h = (nat) ((c >> (4 * sizeof (long int))) >> (4 * sizeof (long int)));
  return (h<<1) ^ (h<<5) ^ (h>>27) ^ ((nat) c); }
nat mmx::exact_hash ( const float &  x) [inline]

Definition at line 99 of file defaults.hpp.

                                       {
return (*((nat*) ((void*) &x))) & 0xffffffff; }
nat mmx::exact_hash ( const double &  x) [inline]

Definition at line 101 of file defaults.hpp.

References n.

                                        {
  union { nat n; double d; } u;
  u.d= x; return u.n; }
nat mmx::exact_hash ( C *  p) [inline]

Definition at line 104 of file defaults.hpp.

References as_hash().

{ return as_hash (p); }
bool exact_neq ( const symbol< C, V > &  s1,
const symbol< C, V > &  s2 
) [inline]

Definition at line 110 of file symbol.hpp.

                                                                {
  return s1.rep != s2.rep; }
bool mmx::exact_neq ( const syntactic &  c1,
const syntactic &  c2 
) [inline]

Definition at line 60 of file syntactic.hpp.

References exact_neq().

                                                                 {
  return exact_neq (*c1, *c2); }
bool mmx::exact_neq ( signed char  c1,
signed char  c2 
) [inline]

Definition at line 126 of file defaults.hpp.

{ return c1 != c2; }
bool mmx::exact_neq ( char  c1,
char  c2 
) [inline]

Definition at line 125 of file defaults.hpp.

{ return c1 != c2; }
bool mmx::exact_neq ( unsigned char  c1,
unsigned char  c2 
) [inline]

Definition at line 127 of file defaults.hpp.

{ return c1 != c2; }
bool mmx::exact_neq ( short int  c1,
short int  c2 
) [inline]

Definition at line 128 of file defaults.hpp.

{ return c1 != c2; }
bool exact_neq ( const generic x1,
const generic x2 
)

Definition at line 610 of file generic.cpp.

References exact_eq().

                                                      {
  return !exact_eq (x1, x2); }
bool exact_neq ( const generic x1,
const int &  x2 
)

Definition at line 612 of file generic.cpp.

References exact_eq().

                                                  {
  return !exact_eq (x1, x2); }
bool mmx::exact_neq ( int  c1,
int  c2 
) [inline]

Definition at line 131 of file defaults.hpp.

{ return c1 != c2; }
bool exact_neq ( const int &  x1,
const generic x2 
)

Definition at line 616 of file generic.cpp.

References exact_neq().

                                                  {
  return exact_neq (x2, x1); }
bool mmx::exact_neq ( short unsigned int  c1,
short unsigned int  c2 
) [inline]

Definition at line 129 of file defaults.hpp.

                                                                     {
  return c1 != c2; }
bool mmx::exact_neq ( long int  c1,
long int  c2 
) [inline]

Definition at line 133 of file defaults.hpp.

{ return c1 != c2; }
bool mmx::exact_neq ( unsigned int  c1,
unsigned int  c2 
) [inline]

Definition at line 132 of file defaults.hpp.

{ return c1 != c2; }
bool mmx::exact_neq ( long unsigned int  c1,
long unsigned int  c2 
) [inline]

Definition at line 134 of file defaults.hpp.

                                                                   {
  return c1 != c2; }
bool mmx::exact_neq ( long long int  c1,
long long int  c2 
) [inline]

Definition at line 136 of file defaults.hpp.

{ return c1 != c2; }
bool mmx::exact_neq ( long long unsigned int  c1,
long long unsigned int  c2 
) [inline]

Definition at line 137 of file defaults.hpp.

                                                                             {
  return c1 != c2; }
bool mmx::exact_neq ( float  x,
float  y 
) [inline]

Definition at line 140 of file defaults.hpp.

{ return x != y; }
bool mmx::exact_neq ( double  x,
double  y 
) [inline]

Definition at line 141 of file defaults.hpp.

{ return x != y; }
bool mmx::exact_neq ( C *  p1,
C *  p2 
) [inline]

Definition at line 142 of file defaults.hpp.

{ return p1 != p2; }
bool mmx::exact_neq ( const compound c1,
const compound c2 
) [inline]

Definition at line 53 of file compound.hpp.

Referenced by compose(), exact_neq(), fall_back_unequal(), hard_neq(), exact_eq_op::not_op(), exact_neq_op::op(), and operator!=().

                                                               {
  return exact_neq (as_symbol (c1), as_symbol (c2)); }
bool mmx::exact_neq ( const document c1,
const document c2 
) [inline]

Definition at line 57 of file document.hpp.

References exact_neq().

                                                               {
  return exact_neq (*c1, *c2); }
bool mmx::exact_neq ( const exception &  e1,
const exception &  e2 
) [inline]

Definition at line 45 of file exception.hpp.

References exact_neq().

                                                                 {
  return exact_neq (*e1, *e2); }
bool mmx::exact_neq ( const literal c1,
const literal c2 
) [inline]

Definition at line 50 of file literal.hpp.

References exact_neq().

                                                             {
  return exact_neq (as_symbol (c1), as_symbol (c2)); }
double exp ( const double &  x) [inline]

Definition at line 44 of file double.hpp.

Referenced by cosh(), GLUE_34(), exp_op::op(), exp_op::op_init(), polar(), exp_op::set_op(), sinh(), and tanh().

{ return std::exp (x); }
generic exp ( const generic x1)

Definition at line 432 of file generic.cpp.

References ACC_EXP, ACC_UNARY, current_ev, and GEN_EXP.

                        {
  ACC_UNARY (ACC_EXP, x1);
  return current_ev->apply (GEN_EXP, x1);
}
syntactic exp ( const syntactic g)

Definition at line 402 of file syntactic.cpp.

References GEN_EXP, and syn().

{ return syn (GEN_EXP, g); }
vector<C,V> mmx::exp ( const vector< C, V > &  v)

Definition at line 1083 of file vector.hpp.

{ return unary_map<exp_op> (v); }
double exp2 ( const double &  x) [inline]

Definition at line 45 of file double.hpp.

Referenced by exp2_op::op(), and exp2_op::set_op().

{ return ::exp2 (x); }
xint exponent ( const generic x)

Definition at line 780 of file generic.cpp.

References ASSERT, current_ev, and GEN_EXPONENT.

                                 {
  generic r= current_ev->apply (GEN_EXPONENT, x);
  ASSERT (is<int> (r), "Int return value expected");
  return as<int> (r); }
xint mmx::exponent ( const double &  x) [inline]

Definition at line 91 of file double.hpp.

References max().

Referenced by GLUE_41(), magnitude(), exponent_op::op(), max_exponent_op::set_op(), and exponent_op::set_op().

                                       {
  return (xint) max (-10000.0, logb (x)); }
xint mmx::exponent ( const vector< C, V > &  v) [inline]

Definition at line 1144 of file vector.hpp.

                                            {
  return big<max_exponent_op> (v); }
vector<C,V> mmx::extend ( const vector< C, V > &  v,
const vector< C2, V2 > &  w 
) [inline]

Definition at line 212 of file vector.hpp.

References is_a_scalar(), is_non_scalar(), N(), Vector, and VERIFY.

Referenced by binary_map(), binary_test(), unary_set(), and vector_map_2().

                                                 {
  VERIFY (is_a_scalar (v), "scalar vector expected");
  VERIFY (is_non_scalar (w), "non-scalar vector expected");
  return Vector (v.scalar(), N(w)); }
vector<C,V> mmx::extract ( const vector< C, V > &  v,
vector< nat e 
)

Definition at line 583 of file vector.hpp.

References C, CF(), N(), and Vector.

                                         {
  nat l= aligned_size<C,V> (N(e));
  C* r= mmx_formatted_new<C> (l, CF(v));
  for (nat i=0; i<N(e); i++)
    if (e[i] < N(v)) r[i]= v[e[i]];
  return Vector (r, N(e), l, CF(v));
}
vector<C,V> mmx::extract_mod ( const vector< C, V > &  v,
nat  k,
nat  p 
)

Definition at line 574 of file vector.hpp.

References C, CF(), N(), n, and Vector.

                                            {
  nat n= (N(v) - k + p - 1) / p;
  nat l= aligned_size<C,V> (n);
  C* r= mmx_formatted_new<C> (l, CF(v));
  for (nat i=0; i<n; i++) r[i]= v[i*p+k];
  return Vector (r, n, l, CF(v));
}
bool mmx::fall_back_equal ( const generic x,
const generic y 
)

Definition at line 29 of file glue.cpp.

References exact_eq().

Referenced by define_prerequisites().

                                                     {
  return exact_eq (x, y);
}
static bool mmx::fall_back_unequal ( const generic x,
const generic y 
) [static]

Definition at line 34 of file glue.cpp.

References exact_neq().

Referenced by define_prerequisites().

                                                       {
  return exact_neq (x, y);
}
fast_helper< T >::fast_type mmx::fast ( const T &  x)

Definition at line 689 of file type_props.hpp.

Referenced by fast_helper< vector< C, V > >::dd(), fast(), fast_op::Fast_type(), and fast_op::set_op().

                  {
  return fast_helper<T>::dd (x);
}
format<typename fast_helper< T >::fast_type > mmx::fast ( const format< T > &  fm) [inline]

Definition at line 704 of file type_props.hpp.

References fast(), get_format(), and get_sample().

                           {
  return get_format (fast (get_sample (fm)));
}
volatile void fatal_error ( char *  message,
char *  routine,
char *  file 
)

Print message coming from routine in file. Exit with 1.

Definition at line 31 of file basix.cpp.

References mmout.

                                                       {
  mmout << "\nFatal error: " << message
        << "\n             in '" << routine
        << "' in file '" << file << "'\n";
  exit (1);
}
bool file_exists ( const string file_name)

Definition at line 156 of file system.cpp.

References as_charp(), decode_name(), and free_charp().

Referenced by init_system(), path_name(), prefix_dir(), resolve_name(), and var_mkdir().

                                 {
  string name_s= decode_name (name);
  char* temp= as_charp (name_s);
  FILE* f= fopen (temp, "r");
  free_charp (temp);
  if (f == NULL) return false;
  fclose (f);
  return true;
}
bool file_is_directory ( const string file_name)

Definition at line 414 of file system.cpp.

References file_test().

{ return file_test (name, "d"); }
bool file_is_file ( const string file_name)

Definition at line 413 of file system.cpp.

References file_test().

{ return file_test (name, "f"); }
bool file_is_script ( const string file_name)

Definition at line 216 of file system.cpp.

References as_charp(), free_charp(), and starts().

                                         {
  char* _file_name= as_charp (file_name);
  FILE* f= fopen (_file_name, "r");
  free_charp (_file_name);
  if (f == NULL) return false;
  char c;
  string s= string ("");
  while ((c = fgetc (f)) != EOF && c != '\n') s << c;
  fclose (f);
  return starts (s, "#!/usr/bin/env mmx-light");

  /*
  port f= input_file_port (file_name);
  if (error_flag (f)) return false;
  char c;
  string s= "";
  while (can_read (f) > 0) {
    f >> c;
    if (c == '\n') break;
    s << c;
  }
  return starts (s, "#!/usr/bin/env mmx-light");
  */
}
double file_last_modified ( const string file_name)

Definition at line 389 of file system.cpp.

References ERROR.

                                        {
  ERROR ("could not get file's last modification time");
}
bool file_test ( const string file_name,
const string attrs 
)

Definition at line 384 of file system.cpp.

Referenced by file_is_directory(), and file_is_file().

                                                     {
  (void) name; (void) buf;
}
vector<C> mmx::fill ( nat  n) [inline]

Definition at line 457 of file vector.hpp.

References C, Format, and n.

             {
  Format fm;
  nat l= default_aligned_size<C> (n);
  C* a= mmx_formatted_new<C> (l, fm);
  return vector<C> (a, n, l, fm);
}
vector<C> mmx::fill ( nat  n,
const format< C > &  fm 
) [inline]

Definition at line 465 of file vector.hpp.

References C, and n.

                               {
  nat l= default_aligned_size<C> (n);
  C* a= mmx_formatted_new<C> (l, fm);
  return vector<C> (a, n, l, fm);
}
vector<C> mmx::fill ( const C &  c,
nat  n 
) [inline]

Definition at line 472 of file vector.hpp.

References C, Format, get_format(), and n.

                         {
  Format fm= get_format (c);
  nat l= default_aligned_size<C> (n);
  C* a= mmx_formatted_new<C> (l, fm);
  for (nat i=0; i<n; i++) a[i]= c;
  return vector<C> (a, n, l, fm);
}
void fill_out ( vec_routine v,
nat n,
nat  i,
const routine r 
)

Definition at line 346 of file generic.cpp.

References n.

Referenced by accelerator< C >::set_apply(), and accelerator< C >::set_construct().

                                                           {
  if (i >= n) {
    nat      new_n= (nat) (1.2 * ((double) (i + 2)));
    routine* new_v= mmx_new<routine> (new_n, routine ());
    for (nat j=0; j<n; j++) new_v[j]= v[j];
    if (v != NULL) mmx_delete<routine> (v, n);
    n= new_n;
    v= new_v;
  }
  v[i]= r;
}
int mmx::find ( const vector< C, V > &  v,
const C &  x 
)

Definition at line 689 of file vector.hpp.

References N(), and n.

                                   {
  nat i, n=N(v);
  for (i=0; i<n; i++)
    if (v[i] == x) return (int) i;
  return (int) i;
}
int mmx::find ( const list< C > &  l,
const C &  x 
)

Definition at line 320 of file list.hpp.

References car(), cdr(), and is_nil().

Referenced by contains(), GLUE_16(), GLUE_17(), and GLUE_18().

                                 {
  if (is_nil (l) || car (l) == x) return 0;
  else return find<C> (cdr (l), x) + 1;
}
C3 C1 mmx::first ( const triple< C1, C2, C3 > &  t) [inline]

Definition at line 40 of file triple.hpp.

{ return t.x1; }
C2 C1 mmx::first ( const pair< C1, C2 > &  p) [inline]

Definition at line 37 of file pair.hpp.

Referenced by cpp_demangle(), sort_op_pair_wrapper< Op >::not_op(), sort_op_pair_wrapper< Op >::op(), and sort_leq().

{ return p.x1; }
syntactic mmx::flatten ( char *const &  s)

Definition at line 540 of file syntactic.cpp.

References quote(), and syn().

                                    {
  return syn ("$text", syntactic (quote (s))); }
syntactic mmx::flatten ( const symbol< C, V > &  s) [inline]

Definition at line 131 of file symbol.hpp.

References apply(), and flatten().

                                                {
  return apply ("symbol", flatten (*s)); }
syntactic mmx::flatten ( const syntactic &  g) [inline]

Definition at line 66 of file syntactic.hpp.

{ return g; }
syntactic mmx::flatten ( const document d) [inline]

Definition at line 68 of file document.hpp.

References as_generic(), as_syntactic(), and gen().

                                             {
  return as_syntactic (gen ("$text", as_generic (d))); }
syntactic mmx::flatten ( C *const &  x) [inline]

Definition at line 312 of file syntactic.hpp.

References as_string().

                       {
  return as_string ((void*) x);
}
syntactic flatten ( const bool &  b)

Definition at line 510 of file syntactic.cpp.

                                  {
  return b? syntactic ("true"): syntactic ("false"); }
syntactic flatten ( const char &  i)

Definition at line 512 of file syntactic.cpp.

References as_string().

                                  {
  return syntactic (as_string (i)); }
syntactic flatten ( const signed char &  i)

Definition at line 514 of file syntactic.cpp.

References as_string().

                                         {
  return syntactic (as_string (i)); }
syntactic flatten ( const unsigned char &  i)

Definition at line 516 of file syntactic.cpp.

References as_string().

                                           {
  return syntactic (as_string (i)); }
syntactic flatten ( const short int &  i)

Definition at line 518 of file syntactic.cpp.

References as_string().

                                       {
  return syntactic (as_string (i)); }
syntactic flatten ( const short unsigned int &  i)

Definition at line 520 of file syntactic.cpp.

References as_string().

                                                {
  return syntactic (as_string (i)); }
syntactic flatten ( const int &  i)

Definition at line 522 of file syntactic.cpp.

References as_string().

                                 {
  return syntactic (as_string (i)); }
syntactic flatten ( const unsigned int &  i)

Definition at line 524 of file syntactic.cpp.

References as_string().

                                          {
  return syntactic (as_string (i)); }
syntactic flatten ( const long int &  i)

Definition at line 526 of file syntactic.cpp.

References as_string().

                                      {
  return syntactic (as_string (i)); }
syntactic flatten ( const long unsigned int &  i)

Definition at line 528 of file syntactic.cpp.

References as_string().

                                               {
  return syntactic (as_string (i)); }
syntactic flatten ( const long long int &  i)

Definition at line 530 of file syntactic.cpp.

References as_string().

                                           {
  return syntactic (as_string (i)); }
syntactic flatten ( const long long unsigned int &  i)

Definition at line 532 of file syntactic.cpp.

References as_string().

                                                    {
  return syntactic (as_string (i)); }
syntactic flatten ( const float &  x)

Definition at line 534 of file syntactic.cpp.

References as_string().

                                   {
  return syntactic (as_string (x)); }
syntactic flatten ( const double &  x)

Definition at line 536 of file syntactic.cpp.

References as_string().

                                    {
  return syntactic (as_string (x)); }
syntactic flatten ( const long double &  x)

Definition at line 538 of file syntactic.cpp.

References as_string().

                                         {
  return syntactic (as_string (x)); }
syntactic mmx::flatten ( const char *const &  s)
syntactic flatten ( const string s)

Definition at line 542 of file syntactic.cpp.

References quote(), and syn().

                                    {
  return syn ("$text", syntactic (quote (s))); }
syntactic flatten ( const compound c)

Definition at line 27 of file compound.cpp.

References as_generic(), as_syntactic(), as_vector(), flatten(), N(), n, and vector_to_compound().

                            {
  const vector<generic> v= as_vector (c);
  nat i, n= N(v);
  vector<generic> w= fill<generic> (n);
  for (i=0; i<n; i++)
    w[i]= as_generic (flatten (v[i]));
  return as_syntactic (vector_to_compound (w));
}
syntactic mmx::flatten ( const table< C, T, V > &  t)

Definition at line 414 of file table.hpp.

References apply(), busy(), flatten(), and iterate().

                         {
  vector<syntactic> v;
  for (iterator<pair<T,C> > it= iterate (t); busy (it); ++it)
    v << flatten (*it);
  return apply ("table", v);
}
syntactic flatten ( const dynamic g)

Definition at line 90 of file dynamic.cpp.

References apply(), attach(), flatten(), inside(), N(), output_observer(), OUTPUT_OBSERVER, and unique_identifier().

                           {
  syntactic r=
    apply ("$dynamic", syntactic (unique_identifier (g)), flatten (g->val));
  for (nat i=0; i<N(g->obs); i++)
    if (g->obs[i]->observer_type () == OUTPUT_OBSERVER)
      return r;
  attach (g, output_observer (inside (g)));
  inside (g) -> ref_count++;  // never destroy printed dynamic objects
  return r;
}
triple<C1,C2,C3> C3 syntactic mmx::flatten ( const triple< C1, C2, C3 > &  t) [inline]

Definition at line 63 of file triple.hpp.

References apply(), flatten(), and GEN_SQTUPLE.

                          {
  return apply (GEN_SQTUPLE, flatten (t.x1), flatten (t.x2), flatten (t.x3));
}
syntactic mmx::flatten ( const tuple< C > &  t)

Definition at line 46 of file tuple.hpp.

References cdr(), compound_to_vector(), flatten(), gen(), and GEN_TUPLE.

                         {
  return flatten (gen (GEN_TUPLE, cdr (compound_to_vector (*t))));
}
syntactic mmx::flatten ( const heap< C > &  h)

Definition at line 254 of file heap.hpp.

References flatten(), and iterate().

                        {
  return flatten (syntactic ("heap"), iterate (h));
}
syntactic mmx::flatten ( const exception &  e) [inline]

Definition at line 52 of file exception.hpp.

References flatten().

{ return flatten (*e); }
syntactic mmx::flatten ( const vector< C, V > &  v)

Definition at line 508 of file vector.hpp.

References apply(), flatten(), GEN_SQTUPLE, is_a_scalar(), N(), and n.

                          {
  if (is_a_scalar (v)) return flatten (v.scalar());
  nat i, n= N(v);
  vector<syntactic> r= fill <syntactic> (n);
  for (i=0; i<n; i++)
    r[i]= flatten (v[i]);
  return apply (GEN_SQTUPLE, r);
}
syntactic mmx::flatten ( const function_0< D > &  f) [inline]

Definition at line 93 of file function.hpp.

References apply().

                                                  {
  return apply ("function", flatten_type<D> ()); }
syntactic mmx::flatten ( const syntactic fun,
const iterator< C > &  it 
)

Definition at line 129 of file iterator.hpp.

References apply(), busy(), and flatten().

                                                   {
  vector<syntactic> v;
  for (; busy (it); ++it)
    v << flatten (*it);
  return apply (fun, v);
}
syntactic mmx::flatten ( const iterator< C > &  it)

Definition at line 137 of file iterator.hpp.

References flatten().

                             {
  return flatten ("iterator", it);
  // NOTE: when C involves the generic type, then traversal of the iterator
  // is a non trivial operations which may cause trouble (like in 1..10)
  // Indeed, the traveral may require operations like < on generic which
  // are not defined in the output evaluator.
  // return flatten (generic ("iterator"), it);
  // (void) it; return "iterator";
}
syntactic mmx::flatten ( const function_1< D, S1 > &  f) [inline]

Definition at line 142 of file function.hpp.

References apply().

                                                  {
  return apply ("function", flatten_type<S1> (), flatten_type<D> ()); }
syntactic mmx::flatten ( const function_2< D, S1, S2 > &  f) [inline]

Definition at line 234 of file function.hpp.

References apply().

                                                  {
  return apply ("function",
                flatten_type<S1> (), flatten_type<S2> (), flatten_type<D> ()); }
syntactic mmx::flatten ( const function_3< D, S1, S2, S3 > &  f) [inline]

Definition at line 287 of file function.hpp.

                                                  {
  return "function"; }
syntactic mmx::flatten ( const chain< C > &  c)

Definition at line 151 of file chain.hpp.

References flatten(), and iterate().

                         {
  return flatten (syntactic ("chain"), iterate (c));
}
syntactic mmx::flatten ( const function_4< D, S1, S2, S3, S4 > &  f) [inline]

Definition at line 339 of file function.hpp.

                                                  {
  return "function"; }
list<C> syntactic mmx::flatten ( const list< C > &  l)

Definition at line 235 of file list.hpp.

References apply(), flatten(), GEN_SQTUPLE, is_nil(), List, read_car(), and read_cdr().

                        {
  vector<syntactic> v;
  List counter= l;
  while (!is_nil (counter)) {
    v << flatten (read_car (counter));
    counter= read_cdr (counter);
  }
  return apply (GEN_SQTUPLE, v);
}
syntactic mmx::flatten ( const function_5< D, S1, S2, S3, S4, S5 > &  f) [inline]

Definition at line 391 of file function.hpp.

                                                  {
  return "function"; }
syntactic mmx::flatten ( const function_6< D, S1, S2, S3, S4, S5, S6 > &  f) [inline]

Definition at line 443 of file function.hpp.

                                                  {
  return "function"; }
syntactic flatten ( const literal s)

Definition at line 17 of file literal.cpp.

References as_syntactic().

                           {
  return as_syntactic (as<generic> (s));
}
syntactic mmx::flatten ( const function_7< D, S1, S2, S3, S4, S5, S6, S7 > &  f) [inline]

Definition at line 495 of file function.hpp.

                                                  {
  return "function"; }
syntactic mmx::flatten ( const function_8< D, S1, S2, S3, S4, S5, S6, S7, S8 > &  f) [inline]

Definition at line 547 of file function.hpp.

                                                  {
  return "function"; }
syntactic mmx::flatten ( const cpp_printer p) [inline]

Definition at line 285 of file cpp_printer.cpp.

                               {
  return "#cpp_printer<>";
}
syntactic mmx::flatten ( const generic g)

Definition at line 136 of file generic.cpp.

References flatten(), and MEMOIZE_UNARY.

                           {
  MEMOIZE_UNARY (std_memoizer,syntactic,generic,flatten,g,
                 g->expression());
}
syntactic mmx::flatten ( const pair< C1, C2 > &  p) [inline]

Definition at line 63 of file pair.hpp.

References apply(), flatten(), and GEN_SQTUPLE.

                        {
  return apply (GEN_SQTUPLE, flatten (p.x1), flatten (p.x2));
}
syntactic mmx::flatten ( const primitive &  fun) [inline]

Definition at line 47 of file primitive.hpp.

References as_syntactic(), GEN_NIL, and is_nil().

                                                {
  if (is_nil (fun)) return as_syntactic (GEN_NIL);
  else return as_syntactic (fun->name); }
syntactic mmx::flatten ( const routine fun) [inline]

Definition at line 100 of file routine.hpp.

References as_syntactic(), GEN_NIL, and is_nil().

                                              {
  if (is_nil (fun)) return as_syntactic (GEN_NIL);
  else return as_syntactic (fun->name); }
syntactic mmx::flatten ( const source_location &  l) [inline]

Definition at line 97 of file source_track.hpp.

References source_location::begin, source_position::column, source_location::end, source_location::file_name, flatten(), gen(), GEN_TUPLE, source_location::input_number, source_position::line, and source_location::obj.

                                   {
  return flatten (gen (GEN_TUPLE, l.obj, l.file_name, l.input_number,
                       gen (GEN_TUPLE, l.begin.line, l.begin.column),
                       gen (GEN_TUPLE, l.end.line, l.end.column)));
}
syntactic mmx::flatten ( const sparse_vector< C, T, V > &  v)

Definition at line 104 of file sparse_vector.hpp.

References apply(), flatten(), and N().

                                 {
  vector<syntactic> r;
  for (nat i=0; i<N(v); i++)
    r << flatten (v[i]);
  return apply ("sparse_vector", r);
}
string flatten_as_cpp ( const generic g)

Definition at line 1227 of file cpp_printer.cpp.

References as_cpp(), as_generic(), and flatten().

                                  {
  generic f= as_generic (flatten (g));
  return as_cpp (f);
}
string flatten_as_lisp ( const generic g)

Definition at line 48 of file lisp_printer.cpp.

References as_generic(), as_lisp(), and flatten().

                                   {
  generic f= as_generic (flatten (g));
  return as_lisp (f);
}
string mmx::flatten_as_math ( const C &  x) [inline]

Definition at line 28 of file math_syntax.hpp.

References as_generic(), as_math(), and flatten().

                             {
  return as_math (as_generic (flatten (x)));
}
string flatten_as_mmx ( const generic g)

Definition at line 910 of file mmx_printer.cpp.

References as_generic(), as_mmx(), and flatten().

Referenced by std_exception().

                                  {
  generic f= as_generic (flatten (g));
  return as_mmx (f);
}
string mmx::flatten_as_texmacs_scheme ( const C &  x) [inline]

Definition at line 40 of file math_syntax.hpp.

References as_generic(), as_texmacs_scheme(), and flatten().

Referenced by output_as_mmx().

                                       {
  return as_texmacs_scheme (as_generic (flatten (x)));
}
string flatten_as_tm ( const generic g)

Definition at line 588 of file mmx_texmacs.cpp.

References as_generic(), as_snippet(), flatten(), is_func(), parse_lisp(), and scheme_to_tm().

                                 {
  string r;
  generic g= as_generic (flatten (x));
  g= parse_lisp (as_snippet (g), true);
  if (is_func (g, "text", 1)) g= g[1];
  scheme_to_tm (r, g, 0);
  return r;
}
string flatten_as_tm ( const generic g,
const string style 
)

Definition at line 598 of file mmx_texmacs.cpp.

References as_generic(), as_snippet(), flatten(), gen(), is_func(), parse_lisp(), and scheme_to_tm().

                                                      {
  string r;
  generic g= as_generic (flatten (x));
  g= parse_lisp (as_snippet (g), true);
  if (is_func (g, "text", 1)) g= g[1];
  if (!is_func (g, "document")) g= gen ("document", g);
  g= gen ("document", gen ("TeXmacs", string ("1.0.7.8")),
          gen ("style", style), gen ("body", g));
  scheme_to_tm (r, g, 0);
  return r;
}
syntactic mmx::flatten_type ( ) [inline]

Definition at line 19 of file function.hpp.

References as_syntactic(), and type_name().

void mmx::floating_to_string ( const C &  val,
string s,
const char *  fm 
) [inline]

Definition at line 194 of file string.cpp.

Referenced by numeric_to_string().

                                                             {
  char buffer[40];
  sprintf (buffer, fm, val);
  s << string (buffer);
}
double floor ( const double &  x) [inline]

Definition at line 125 of file double.hpp.

Referenced by floor_op::op(), round(), and floor_op::set_op().

{ return std::floor (x); }
generic floor ( const generic x)

Definition at line 748 of file generic.cpp.

References current_ev, and GEN_FLOOR.

                                 {
  return current_ev->apply (GEN_FLOOR, x); }
void mmx::flush ( const port &  p) [inline]

Definition at line 113 of file port.hpp.

References inside().

Referenced by composite_port_rep::flush(), and GLUE_18().

                                  {
  inside (p)->flush (); }
string follow_link ( const string name,
const bool &  recurse 
)

Definition at line 396 of file system.cpp.

References as_charp(), decode_name(), and free_charp().

                                                      {
  char buf[1024];
  string name_s= decode_name (name);
  char* temp= as_charp (name_s);
  int n= readlink (temp, buf, 1024);
  free_charp (temp);
  if (n >= 0 && n < 1024) {
    string r (buf, n);
    if (recurse) return follow_link (r, true);
    else return r;
  }
  else {
    if (recurse) return name;
    else return "";
  }
}
port formatting_port ( const port &  p)

Definition at line 101 of file formatting_port.cpp.

                                {
  return (port_rep*) new formatting_port_rep (p);
}
void free_charp ( char *  s)

Free memory allocated within as_charp.

Definition at line 83 of file string.cpp.

References mmx_free().

Referenced by dl_link(), file_exists(), file_is_script(), follow_link(), get_env(), input_file_port(), input_output_file_port(), load_directory(), output_file_port(), socket_client_port(), system(), and var_mkdir().

                     {
  mmx_free (s, strlen (s) + 1);
}
C mmx::fuzz_cst ( ) [inline]

Definition at line 747 of file type_props.hpp.

References C, and set_fuzz().

{ C r; set_fuzz (r); return r; }
syntactic gaussian ( const syntactic g1,
const syntactic g2 
)

Definition at line 429 of file syntactic.cpp.

References Imaginary.

                                                              {
  return g1 + g2 * Imaginary (syntactic); }
generic gaussian ( const generic x1,
const generic x2 
)

Definition at line 739 of file generic.cpp.

References Imaginary.

Referenced by gaussian_op::op().

                                                        {
  return x1 + x2 * Imaginary (generic); }
syntactic gcd ( const syntactic g1,
const syntactic g2 
)

Definition at line 376 of file syntactic.cpp.

References exact_eq(), GEN_GCD, and syn().

                                                         {
  if (exact_eq (g1, 0)) return g2;
  if (exact_eq (g2, 0)) return g1;
  return syn (GEN_GCD, g1, g2);
}
generic gcd ( const generic x1,
const generic x2 
)

Definition at line 716 of file generic.cpp.

References current_ev, and GEN_GCD.

Referenced by gcd_op::op(), and gcd_op::set_op().

                                                   {
  return current_ev->apply (GEN_GCD, x1, x2); }
signed char mmx::gcd ( const signed char  a,
const signed char  b 
) [inline]

Definition at line 557 of file int.hpp.

{                                       \
signed char mmx::gcd ( const signed char  a,
const signed char  b,
signed char &  co_a 
) [inline]

Definition at line 557 of file int.hpp.

{                                       \
signed char mmx::gcd ( const signed char  a,
const signed char  b,
signed char &  co_a,
signed char &  co_b 
) [inline]

Definition at line 557 of file int.hpp.

{                                       \
short int mmx::gcd ( const short int  a,
const short int  b 
) [inline]

Definition at line 558 of file int.hpp.

{                                       \
short int mmx::gcd ( const short int  a,
const short int  b,
short int &  co_a 
) [inline]

Definition at line 558 of file int.hpp.

{                                       \
short int mmx::gcd ( const short int  a,
const short int  b,
short int &  co_a,
short int &  co_b 
) [inline]

Definition at line 558 of file int.hpp.

{                                       \
int mmx::gcd ( const int  a,
const int  b 
) [inline]

Definition at line 559 of file int.hpp.

{                                       \
long int mmx::gcd ( const long int  a,
const long int  b 
) [inline]

Definition at line 560 of file int.hpp.

{                                       \
int mmx::gcd ( const int  a,
const int  b,
int &  co_a,
int &  co_b 
) [inline]

Definition at line 559 of file int.hpp.

{                                       \
long int mmx::gcd ( const long int  a,
const long int  b,
long int &  co_a 
) [inline]

Definition at line 560 of file int.hpp.

{                                       \
long int mmx::gcd ( const long int  a,
const long int  b,
long int &  co_a,
long int &  co_b 
) [inline]

Definition at line 560 of file int.hpp.

{                                       \
long long int mmx::gcd ( const long long int  a,
const long long int  b 
) [inline]

Definition at line 561 of file int.hpp.

{                                       \
long long int mmx::gcd ( const long long int  a,
const long long int  b,
long long int &  co_a 
) [inline]

Definition at line 561 of file int.hpp.

{                                       \
long long int mmx::gcd ( const long long int  a,
const long long int  b,
long long int &  co_a,
long long int &  co_b 
) [inline]

Definition at line 561 of file int.hpp.

{                                       \
unsigned short int mmx::gcd ( const unsigned short int  a,
const unsigned short int  b 
) [inline]

Definition at line 569 of file int.hpp.

unsigned int mmx::gcd ( const unsigned int  a,
const unsigned int  b 
) [inline]

Definition at line 570 of file int.hpp.

unsigned long int mmx::gcd ( const unsigned long int  a,
const unsigned long int  b 
) [inline]

Definition at line 571 of file int.hpp.

unsigned long long int mmx::gcd ( const unsigned long long int  a,
const unsigned long long int  b 
) [inline]

Definition at line 572 of file int.hpp.

int mmx::gcd ( const int  a,
const int  b,
int &  co_a 
) [inline]

Definition at line 559 of file int.hpp.

{                                       \
unsigned char mmx::gcd ( const unsigned char  a,
const unsigned char  b 
) [inline]

Definition at line 568 of file int.hpp.

generic gen ( const generic x1,
const vector< generic > &  v 
)

Definition at line 58 of file compound.cpp.

References cons().

Referenced by accelerate_converter(), access(), add_modes(), all_type_names(), evaluator_rep::apply(), as_texmacs(), attach_generic_binary_assembler(), bigop(), binary_assemble_generic(), bracket(), collect(), comma(), concat(), concat_append(), define_type_helper< C >::def_type(), define_converter(), define_type_sub(), define_user_type(), documentify(), flatten(), flatten_as_tm(), binary_helper< vector< C, V > >::full_type_name(), binary_helper< triple< C1, C2, C3 > >::full_type_name(), binary_helper< table< C, T, V > >::full_type_name(), binary_helper< symbol< C, V > >::full_type_name(), binary_helper< sparse_vector< C, T, V > >::full_type_name(), binary_helper< format< T > >::full_type_name(), binary_helper< pair< C1, C2 > >::full_type_name(), binary_helper< list< C > >::full_type_name(), binary_helper< iterator< C > >::full_type_name(), binary_helper< heap< C > >::full_type_name(), binary_helper< chain< C > >::full_type_name(), routine_rep::function_type(), glue_list_generic(), glue_routine(), glue_table_generic(), glue_vector_generic(), hlist(), include(), indented(), infix(), keyword(), has< T, Op >::lazy_value(), both< T1, T2 >::lazy_value(), list_foreach(), make_document(), make_math(), make_row(), make_texmacs(), make_text(), sum_less_op::op(), sign_op::op(), operate(), postfix(), prefix(), replace_lf(), std_exception(), syn(), texmacs_expand(), trace_pull(), trace_push(), trace_top(), type_id(), type_name(), un_try_catch(), user_exception(), vector_foreach(), vlist(), void_value(), and WRAP_INDIRECT_IMPL().

                                                  {
  return as<generic> (compound (cons (x1, v)));
}
generic gen ( )

Definition at line 63 of file compound.cpp.

       {
  return as<generic> (compound (vec<generic> ()));
}
generic gen ( const generic x1)

Definition at line 68 of file compound.cpp.

                        {
  return as<generic> (compound (vec<generic> (x1)));
}
generic gen ( const generic x1,
const string x2 
)

Definition at line 78 of file compound.cpp.

                                          {
  return as<generic> (compound (vec<generic> (x1, generic (x2))));
}
generic gen ( const generic x1,
const generic x2 
)

Definition at line 73 of file compound.cpp.

                                           {
  return as<generic> (compound (vec<generic> (x1, x2)));
}
generic gen ( const generic x1,
const generic x2,
const generic x3 
)

Definition at line 83 of file compound.cpp.

                                                              {
  return as<generic> (compound (vec<generic> (x1, x2, x3)));
}
generic gen ( const generic x1,
const generic x2,
const generic x3,
const generic x4 
)

Definition at line 88 of file compound.cpp.

                                           {
  return as<generic> (compound (vec<generic> (x1, x2, x3, x4)));
}
generic gen ( const generic x1,
const generic x2,
const generic x3,
const generic x4,
const generic x5 
)

Definition at line 94 of file compound.cpp.

                                                              {
  return as<generic> (compound (vec<generic> (x1, x2, x3, x4, x5)));
}
generic gen ( const generic x1,
const generic x2,
const generic x3,
const generic x4,
const generic x5,
const generic x6 
)

Definition at line 100 of file compound.cpp.

                                           {
  return as<generic> (compound (vec<generic> (x1, x2, x3, x4, x5, x6)));
}
generic mmx::GEN_ABS ( "abs"  )
generic mmx::GEN_ACCESS ( "."  [])
generic mmx::GEN_ACCURACY ( "accuracy"  )
generic mmx::GEN_ADDITIVE_ERROR ( "additive_error"  )
generic mmx::GEN_ALIAS ( "alias"  )
generic mmx::GEN_ALL_TYPES ( "all_types"  )
generic mmx::GEN_AND ( "/\\"  )
generic mmx::GEN_APPLY ( ".()"  )
generic mmx::GEN_ARCCOS ( "arccos"  )
generic mmx::GEN_ARCSIN ( "arcsin"  )
generic mmx::GEN_ARCTAN ( "arctan"  )
generic mmx::GEN_ARCTAN2 ( "arctan2"  )
generic mmx::GEN_ARG ( "arg"  )
generic mmx::GEN_ARGCH ( "argch"  )
generic mmx::GEN_ARGSH ( "argsh"  )
generic mmx::GEN_ARGTH ( "argth"  )
generic mmx::GEN_ASSIGN_MACRO ( ":  ,
 
)
generic mmx::GEN_ASSUME ( "assume"  )
generic mmx::GEN_BACKTRACE ( "backtrace"  )
generic mmx::GEN_BALL ( "ball"  )
generic mmx::GEN_BEGIN ( "begin"  )
generic mmx::GEN_BLUR ( "blur"  )
generic mmx::GEN_BOOLEAN_TYPE ( "Boolean"  )
generic mmx::GEN_BREAK ( "break"  )
generic mmx::GEN_CACHE_CONVERTER ( "cache/converter"  )
generic mmx::GEN_CACHE_CONVERTERS ( "cache/converters"  )
generic mmx::GEN_CACHE_PENALTY ( "cache/penalty"  )
generic mmx::GEN_CASE ( "case"  )
generic mmx::GEN_CAST ( "cast"  )
generic mmx::GEN_CATALAN ( "mathcatalan"  )
generic mmx::GEN_CATCH ( "catch"  )
generic mmx::GEN_CATEGORY ( "category"  )
generic mmx::GEN_CBRT ( "cbrt"  )
generic mmx::GEN_CEIL ( "ceil"  )
generic mmx::GEN_CENTER ( "center"  )
generic mmx::GEN_CH ( "ch"  )
generic mmx::GEN_CHANGE_PRECISION ( "change_precision"  )
generic mmx::GEN_CLASS ( "class"  )
generic mmx::GEN_CLASS_ACCESS ( "class/access"  )
generic mmx::GEN_CLASS_ENCAPSULATION ( "class/encapsulation"  )
generic mmx::GEN_CLASS_EXPORT ( "class/export"  )
generic mmx::GEN_CLASS_FIELDS ( "class/fields"  )
generic mmx::GEN_CLASS_MODE ( "class/mode"  )
generic mmx::GEN_CLASS_NAME ( "class/name"  )
generic mmx::GEN_CLOSURE ( "closure"  )
generic mmx::GEN_COERCE ( "coerce"  )
generic mmx::GEN_COERCE_TYPE ( "Coerce"  )
generic mmx::GEN_COMMA ( ,
 
)
generic mmx::GEN_COMPOUND_TYPE ( "Compound"  )
generic mmx::GEN_CONJ ( "conj"  )
generic mmx::GEN_CONSTANT ( "constant"  )
generic mmx::GEN_CONSTRUCTOR ( "constructor"  )
generic mmx::GEN_CONTINUE ( "continue"  )
generic mmx::GEN_CONVERT ( ":  ,
 
)
generic mmx::GEN_CONVERTER ( "converter"  )
generic mmx::GEN_CONVERTERS ( "converters"  )
generic mmx::GEN_CONVERTS ( "~  ,
 
)
generic mmx::GEN_COS ( "cos"  )
generic mmx::GEN_D ( "mathd"  )
generic mmx::GEN_DEFINE_MACRO ( = =,
 
)
generic mmx::GEN_DELTA ( "delta"  )
generic mmx::GEN_DENOMINATOR ( "denominator"  )
generic mmx::GEN_DERIVATIVE ( "derivative"  )
generic mmx::GEN_DERIVE ( "derive"  )
generic mmx::GEN_DESTRUCTOR ( "destructor"  )
generic mmx::GEN_DIV ( "div"  )
generic mmx::GEN_DOT ( "."  )
generic mmx::GEN_DOUBLE_TYPE ( "Double"  )
generic mmx::GEN_DOWNGRADE ( "downgrade"  )
generic mmx::GEN_DOWNTO ( "downto"  )
generic mmx::GEN_DUPLICATE ( "duplicate"  )
generic mmx::GEN_E ( "mathe"  )
generic mmx::GEN_ELEMENTARY_ERROR ( "elementary_error"  )
generic mmx::GEN_ELSE ( "else"  )
bool mmx::gen_eq ( const generic &  g1,
const generic &  g2 
) [inline]

Definition at line 164 of file generic.hpp.

Referenced by gen_eq_op::op().

                                                          {
  return g1->is_hard_eq (g2); }
generic mmx::GEN_EQUALIZE_GROUPED ( "equalize_grouped"  )
generic mmx::GEN_EQUIV ( "<=  ,
 
)
generic mmx::GEN_ERF ( "erf"  )
generic mmx::GEN_ERROR ( "error"  )
generic mmx::GEN_EULER ( "matheuler"  )
generic mmx::GEN_EXACT_EQ ( "exact_eq"  )
generic mmx::GEN_EXACT_HASH ( "exact_hash"  )
generic mmx::GEN_EXACT_NEQ ( "exact_neq"  )
generic mmx::GEN_EXCEPTION ( "exception"  )
generic mmx::GEN_EXISTS ( "exists"  )
generic mmx::GEN_EXP ( "exp"  )
generic mmx::GEN_EXP10 ( "exp10"  )
generic mmx::GEN_EXP2 ( "exp2"  )
generic mmx::GEN_EXPECTED ( "expected"  )
generic mmx::GEN_EXPONENT ( "exponent"  )
generic mmx::GEN_EXPORT ( "export"  )
generic mmx::GEN_EXTERN ( "extern"  )
generic mmx::GEN_FALSE ( "false"  )
generic mmx::GEN_FAST ( "fast"  )
generic mmx::GEN_FILL ( "^^"  )
generic mmx::GEN_FLATTEN ( "flatten"  )
generic mmx::GEN_FLOATING_TYPE ( "Floating"  )
generic mmx::GEN_FLOOR ( "floor"  )
generic mmx::GEN_FOR ( "for"  )
generic mmx::GEN_FORALL ( "forall"  )
generic mmx::GEN_FOREIGN ( "foreign"  )
generic mmx::GEN_FUNCTION_TYPE ( "Function"  )
generic mmx::GEN_FUZZ ( "Fuzz"  )
generic mmx::GEN_GAMMA ( "gamma"  )
generic mmx::GEN_GAUSSIAN ( "gaussian"  )
generic mmx::GEN_GCD ( "gcd"  )
generic mmx::GEN_GENERATE ( "generate"  )
generic mmx::GEN_GENERATOR_TYPE ( "Generator"  )
generic mmx::GEN_GENERIC_ALIAS_TYPE ( "Generic_alias"  )
generic mmx::GEN_GENERIC_TYPE ( "Generic"  )
generic mmx::GEN_GLOBAL ( "global"  )
generic mmx::GEN_GRAD ( "grad"  )
generic mmx::GEN_GRAEFFE ( "graeffe"  )
generic mmx::GEN_GTR ( ,
 
)
generic mmx::GEN_GTREQ ( ">="  )
generic mmx::GEN_HARD_EQ ( "hard_eq"  )
generic mmx::GEN_HARD_GTR ( "hard_gtr"  )
generic mmx::GEN_HARD_HASH ( "hard_hash"  )
generic mmx::GEN_HARD_LESS ( "hard_less"  )
generic mmx::GEN_HARD_NEQ ( "hard_neq"  )
generic mmx::GEN_HAS ( "has"  )
generic mmx::GEN_HASH ( "hash"  )
nat mmx::gen_hash ( const generic &  g) [inline]

Definition at line 158 of file generic.hpp.

Referenced by gen_eq_op::hash_op().

                                       {
  return g->get_hard_hash_value (); }
generic mmx::GEN_HAT ( ".^"  )
generic mmx::GEN_HYPOT ( "hypot"  )
generic mmx::GEN_I ( "mathi"  )
generic mmx::GEN_IDENTITY ( "identity"  )
generic mmx::GEN_IF ( "if"  )
generic mmx::GEN_IM ( "Im"  )
generic mmx::GEN_IMPLIES ( ,
 
)
generic mmx::GEN_IMPORT ( "import"  )
generic mmx::GEN_IN ( "in"  )
generic mmx::GEN_INFINITY ( "Infty"  )
generic mmx::GEN_INFIX ( "infix"  )
generic mmx::GEN_INLINE ( "inline"  )
generic mmx::GEN_INPLACE ( "inplace"  )
generic mmx::GEN_INTEGER_TYPE ( "Integer"  )
generic mmx::GEN_INTEGRATE ( "integrate"  )
generic mmx::GEN_INTERN ( "intern"  )
generic mmx::GEN_INTERVAL ( "interval"  )
generic mmx::GEN_INTO ( "->"  )
generic mmx::GEN_INVERT ( "invert"  )
generic mmx::GEN_KEYWORD ( "keyword"  )
generic mmx::GEN_LAMBDA ( "lambda"  )
generic mmx::GEN_LARGEST ( "largest"  )
generic mmx::GEN_LCM ( "lcm"  )
generic mmx::GEN_LIFT ( "lift"  )
generic mmx::GEN_LIST ( "list"  )
generic mmx::GEN_LITERAL_TYPE ( "Literal"  )
generic mmx::GEN_LOCAL ( "local"  )
generic mmx::GEN_LOG ( "log"  )
generic mmx::GEN_LOG10 ( "log10"  )
generic mmx::GEN_LOG2 ( "log2"  )
generic mmx::GEN_LOG2_AS ( "set_log2"  )
generic mmx::GEN_LOOP ( "loop"  )
generic mmx::GEN_LOWER ( "lower"  )
generic mmx::GEN_MACRO ( "macro"  )
generic mmx::GEN_MAGNITUDE ( "magnitude"  )
generic mmx::GEN_MAPSTO ( ":->"  )
generic mmx::GEN_MAX ( "max"  )
generic mmx::GEN_METHOD ( "method"  )
generic mmx::GEN_MIN ( "min"  )
generic mmx::GEN_MOD ( "mod"  )
generic mmx::GEN_MODULE ( "module"  )
generic mmx::GEN_MUL_ADD ( "mul_add"  )
generic mmx::GEN_MUL_SUB ( "mul_sub"  )
generic mmx::GEN_MULTIPLICATIVE_ERROR ( "multiplicative_error"  )
generic mmx::GEN_MUTABLE ( "mutable"  )
generic mmx::GEN_NAN ( "NaN"  )
bool mmx::gen_neq ( const generic &  g1,
const generic &  g2 
) [inline]

Definition at line 166 of file generic.hpp.

Referenced by gen_eq_op::not_op().

                                                           {
  return !g1->is_hard_eq (g2); }
generic mmx::GEN_NEW ( "new"  )
generic mmx::GEN_NEXT_ABOVE ( "next_above"  )
generic mmx::GEN_NEXT_BELOW ( "next_below"  )
generic mmx::GEN_NIL ( "nil"  )
generic mmx::GEN_NOOP ( "noop"  )
generic mmx::GEN_NOT ( "!"  )
generic mmx::GEN_NUMERATOR ( "numerator"  )
generic mmx::GEN_OPERATOR ( "operator"  )
generic mmx::GEN_OR ( "\\/"  )
generic mmx::GEN_PARTIAL ( "partial"  )
generic mmx::GEN_PENALTY ( "penalty"  )
generic mmx::GEN_PI ( "mathpi"  )
generic mmx::GEN_POLAR ( "polar"  )
generic mmx::GEN_POSTFIX ( "postfix"  )
generic mmx::GEN_PRECISION ( "precision"  )
generic mmx::GEN_PREFIX ( "prefix"  )
generic mmx::GEN_PRIME ( ".'"  )
generic mmx::GEN_PRIVATE ( "private"  )
generic mmx::GEN_PROJECT ( "project"  )
generic mmx::GEN_PUBLIC ( "public"  )
generic mmx::GEN_QUO ( "quo"  )
generic mmx::GEN_RADIUS ( "radius"  )
generic mmx::GEN_RAISE ( "raise"  )
generic mmx::GEN_RANGE ( ".."  )
generic mmx::GEN_RATIONAL_TYPE ( "Rational"  )
generic mmx::GEN_RE ( "Re"  )
generic mmx::GEN_REM ( "rem"  )
generic mmx::GEN_RETURN ( "return"  )
generic mmx::GEN_REVERSE ( "reverse"  )
generic mmx::GEN_REWRITE ( "rewrite"  )
generic mmx::GEN_ROUND ( "round"  )
generic mmx::GEN_ROUNDING_ERROR ( "rounding_error"  )
generic mmx::GEN_ROUTINE_TYPE ( "Routine"  )
generic mmx::GEN_ROW ( "(.)"  )
generic mmx::GEN_SCOPE ( "::"  )
generic mmx::GEN_SEQAND ( "and"  )
generic mmx::GEN_SEQOR ( "or"  )
generic mmx::GEN_SH ( "sh"  )
generic mmx::GEN_SHARPEN ( "sharpen"  )
generic mmx::GEN_SIN ( "sin"  )
generic mmx::GEN_SINGLE_TYPE ( "Single"  )
generic mmx::GEN_SLOW ( "slow"  )
generic mmx::GEN_SMALLEST ( "smallest"  )
generic mmx::GEN_SOLVE ( "solve"  )
generic mmx::GEN_SPECIALIZE ( "specialize"  )
generic mmx::GEN_SPECIALIZE_ALIAS ( "specialize_alias"  )
generic mmx::GEN_SQRT ( "sqrt"  )
generic mmx::GEN_SQUARE ( "square"  )
generic mmx::GEN_STAR ( ".*"  )
generic mmx::GEN_STEP ( "step"  )
generic mmx::GEN_SUBSTITUTE ( "substitute"  )
generic mmx::GEN_SYMBOL_TYPE ( "Symbol"  )
generic mmx::GEN_TAN ( "tan"  )
generic mmx::GEN_TH ( "th"  )
generic mmx::GEN_THIS ( "this"  )
generic mmx::GEN_TILDA ( ".~"  )
generic mmx::GEN_TO ( "to"  )
generic mmx::GEN_TRANSITIVE ( "transitive"  )
generic mmx::GEN_TRANSTYPE ( ":  ,
 
)
generic mmx::GEN_TRUE ( "true"  )
generic mmx::GEN_TRUNC ( "trunc"  )
generic mmx::GEN_TRY ( "try"  )
generic mmx::GEN_TUPLE ( "()"  )
generic mmx::GEN_TYPE_ID ( "type_id"  )
generic mmx::GEN_TYPE_NAME ( "type_name"  )
generic mmx::GEN_UNALIAS ( "unalias"  )
generic mmx::GEN_UNSPECIFIED_TYPE ( "Unspecified"  )
generic mmx::GEN_UNTIL ( "until"  )
generic mmx::GEN_UPGRADE ( "upgrade"  )
generic mmx::GEN_UPPER ( "upper"  )
generic gen_vec ( const generic g1)

Definition at line 59 of file generic.cpp.

                                    {
  return as<generic> (vec<generic> (g1)); }
generic gen_vec ( const generic g1,
const generic g2 
)

Definition at line 61 of file generic.cpp.

                                                       {
  return as<generic> (vec<generic> (g1, g2)); }
generic gen_vec ( const generic g1,
const generic g2,
const generic g3 
)

Definition at line 63 of file generic.cpp.

                                                                          {
  return as<generic> (vec<generic> (g1, g2, g3)); }
generic mmx::GEN_VIA_TUPLE ( "via_tuple"  )
generic mmx::GEN_WHILE ( "while"  )
generic mmx::GEN_XDERIVE ( "xderive"  )
generic mmx::GEN_XGCD ( "xgcd"  )
generic mmx::GEN_XOR ( "xor"  )
generic mmx::GEN_YIELD ( "yield"  )
generic mmx::GEN_ZETA ( "zeta"  )
alias<generic> mmx::generalize_genalias ( const generic_alias< C > &  a) [inline]

Definition at line 132 of file alias.hpp.

                                                                        {
  return *a; }
generic mmx::generic_assemble ( const generic &  x) [inline]

Definition at line 309 of file port.hpp.

Referenced by GLUE_25().

                                                   {
  return binary_assemble<generic> (x); }
static int mmx::generic_compare ( const generic x,
const generic y 
) [static]

Definition at line 117 of file glue_list_map.cpp.

References current_comparison.

Referenced by list_sort().

                                                     {
  bool b= as<bool> (current_comparison->apply (x, y));
  return b? -1: 1;
}
generic mmx::generic_disassemble ( const generic &  x) [inline]

Definition at line 307 of file port.hpp.

Referenced by GLUE_26().

                                                      {
  return binary_disassemble<generic> (x); }
generic get_alias ( const generic a)

Definition at line 75 of file alias.cpp.

References alias_getter(), and type().

                             {
  routine r;
  alias_getter (type (a), r);
  return r->apply (a);
}
static bool mmx::get_attributes ( const string name,
struct stat *  buf 
) [static]

Definition at line 378 of file system.cpp.

                                                      {
  (void) name; (void) buf;
  return 1;
}
string get_directory ( const string name)

Definition at line 242 of file system.cpp.

References N().

Referenced by canonical_name(), and resolve_name().

                                   {
  for (int i= N(name)-1; i>=0; i--)
    if (name[i]=='/')
      return name (0, i);
  return ".";
}
string get_env ( const string var)

Definition at line 37 of file system.cpp.

References as_charp(), and free_charp().

Referenced by decode_name(), load_path(), path_name(), prefix_dir(), sysconf_dir(), user_dir(), and var_load().

                            {
  char* _var= as_charp (var);
  char* _ret= getenv (_var);
  free_charp (_var);
  if (_ret == NULL) return "";
  string ret (_ret);
  return ret;
  // do not delete _ret !
}
string get_extension ( const string name)

Definition at line 268 of file system.cpp.

References N().

                                   {
  for (int i= N(name)-1; i>=0; i--)
    if (name[i]=='.')
      return name (i+1, N(name));
    else if (name[i]=='/')
      return "";
  return "";
}
static string mmx::get_file_source ( const string file_name,
nat  line 
) [static]

Definition at line 76 of file source_track.cpp.

References ASSERT, file_sources, line, N(), and read().

                                                    {
  if (!file_sources->contains (file_name)) return "";
  ASSERT (line < N (read (file_sources, file_name)), "source out of range");
  return read (file_sources, file_name) [line];
}
string get_file_source ( const string file_name)

Definition at line 71 of file source_track.cpp.

References file_sources, and recompose().

Referenced by get_source().

                                          {
  return recompose (file_sources [file_name], "\n");
}
format<C> mmx::get_format ( const C &  x) [inline]

Definition at line 180 of file type_props.hpp.

                        {
  return typename format<C>::FT (x);
}
format<typename coefficient1_type_helper< C >::val > mmx::get_format1 ( const format< C > &  fm) [inline]

Definition at line 190 of file type_props.hpp.

References empty_format::format1().

                                  {
  return format<Coefficient1_type(C) > (fm.format1 ());
}
format<typename coefficient2_type_helper< C >::val > mmx::get_format2 ( const format< C > &  fm) [inline]

Definition at line 195 of file type_props.hpp.

References empty_format::format2().

                                  {
  return format<Coefficient2_type(C) > (fm.format2 ());
}
C mmx::get_genalias ( const generic_alias< C > &  a) [inline]

Definition at line 134 of file alias.hpp.

Referenced by WRAP_WRAPPED_IMPL().

                                                    {
  return as<C> ((*a)->get ()); }
nat get_indentation ( const string s)

Definition at line 583 of file string.cpp.

References min(), N(), and tokenize().

Referenced by source_string_unindented().

                                  {
  if (N(s) == 0) return 0;
  vector<string> v= tokenize (s, "\n");
  nat r= ((nat) -1);
  for (nat y=0; y<N(v); y++)
    for (nat x=0; x<N(v[y]); x++)
      if (v[y][x] != ' ') {
        r= min (r, x);
        break;
      }
  return r;
}
nat get_interactive_number ( void  )

Definition at line 40 of file source_track.cpp.

References interactive_sources, and N().

Referenced by store_interactive_source().

                              {
  return N(interactive_sources) ;
}
static string mmx::get_interactive_source ( nat  i,
nat  l 
) [static]

Definition at line 59 of file source_track.cpp.

References ASSERT, interactive_sources, and N().

                                      {
  ASSERT (i < N (interactive_sources), "source out of range");
  ASSERT (l < N (interactive_sources[i]), "source out of range");
  return interactive_sources[i][l];
}
string get_interactive_source ( nat  i)

Definition at line 53 of file source_track.cpp.

References ASSERT, interactive_sources, N(), and recompose().

Referenced by get_source().

                               {
  ASSERT (i < N (interactive_sources), "source out of range");
  return recompose (interactive_sources[i], '\n');
}
int get_number_cores ( )

Definition at line 234 of file threads.cpp.

                    {
#ifdef __linux__ // also to be used for Solaris, AIX, ...
  int nr1= sysconf (_SC_NPROCESSORS_ONLN);
  if (nr1 >= 1) return nr1;
#endif

#ifdef __APPLE__ // also to be used for BSD system
  int mib[2] = { CTL_HW, HW_AVAILCPU };
  //int mib[2] = { CTL_HW, HW_NCPU };
  int nr2;
  size_t len;
  len = sizeof (nr2);
  sysctl (mib, 2, &nr2, &len, NULL, 0);
  if (nr2 >= 1) return nr2;
#endif

#ifdef __WINDOW__upcoming
  SYSTEM_INFO sysinfo;
  GetSystemInfo( &sysinfo );
  int nr3= sysinfo.dwNumberOfProcessors;
  if (nr3 >= 1) return nr3;
#endif

#ifdef __HPUX__upcoming
  int nr4= mpctl (MPC_GETNUMSPUS, NULL, NULL);
  if (nr4 >= 1) return nr4;
#endif

#ifdef __IRIX__upcoming
  int nr5= sysconf (_SC_NPROC_ONLN);
  if (nr5 >= 1) return nr5;
#endif

  return 1;
}
C mmx::get_sample ( const format< C > &  fm) [inline]

Definition at line 185 of file type_props.hpp.

References format< C >::sample().

                                 {
  return fm.sample ();
}
string mmx::get_source ( const string file_name,
nat  i 
)

Definition at line 83 of file source_track.cpp.

References get_file_source(), and get_interactive_source().

                                            {
  if (file_name == "") return get_interactive_source (i);
  return get_file_source (file_name);
}
string get_source ( const string file_name,
nat  input_number,
nat  line 
)

Definition at line 89 of file source_track.cpp.

References get_file_source(), and get_interactive_source().

Referenced by source_string(), source_string_unindented(), and underlined().

                                                      {
  if (file_name == "") return get_interactive_source (i, line);
  return get_file_source (file_name, line);
}
C get_top ( const heap< C > &  h) [inline]

Definition at line 187 of file heap.hpp.

Referenced by heap_iterator_rep< C >::current().

                                      {
  return h.rep->Get_top (); }
nat get_user_type ( const generic name)

Definition at line 182 of file generic_object.cpp.

References define_user_type(), GEN_ALIAS_TYPE, GEN_GENERIC_ALIAS_TYPE, GEN_TUPLE_TYPE, is_func(), and type_id().

                                    {
  nat r= type_id (name);
  if (r == 1) {
    generic tp= name;
    if (is_func (tp, GEN_TUPLE_TYPE, 1)) tp= tp[1];
    if (is_func (tp, GEN_ALIAS_TYPE, 1)) tp= tp[1];
    if (is_func (tp, GEN_GENERIC_ALIAS_TYPE, 1)) tp= tp[1];
    define_user_type (tp);
    r= type_id (name);
  }
  return r;
}
alias<C> mmx::global_alias ( C &  c)

Definition at line 87 of file alias.hpp.

                    {
  return new global_alias_rep<C> (c);
}
nat mmx::global_type_id ( ) [inline]

Definition at line 177 of file generic.hpp.

References new_type_id(), and T.

{ return new_type_id (typeid (T ()).name()); }  
static double mmx::GLUE_1 ( const literal arg_1) [static]

Definition at line 10 of file glue_double.cpp.

References double_literal.

                                {
    return double_literal (arg_1);
  }
static port mmx::GLUE_1 ( const string arg_1) [static]

Definition at line 9 of file glue_port.cpp.

References input_string_port().

                               {
    return input_string_port (arg_1);
  }
static vector<routine> mmx::GLUE_1 ( const tuple< routine > &  arg_1) [static]

Definition at line 10 of file glue_routine.cpp.

References as_vector().

                                       {
    return vector<routine > (as_vector (arg_1));
  }
static document mmx::GLUE_10 ( const document arg_1) [static]
static vector<generic> mmx::GLUE_10 ( const vector< generic > &  arg_1,
const vector< generic > &  arg_2 
) [static]

Definition at line 54 of file glue_vector_generic.cpp.

References append().

                                                                       {
    return append (arg_1, arg_2);
  }
static double mmx::GLUE_10 ( const double &  arg_1,
const double &  arg_2 
) [static]

Definition at line 55 of file glue_double.cpp.

                                                     {
    return arg_1 - arg_2;
  }
static int mmx::GLUE_10 ( const int &  arg_1,
const int &  arg_2 
) [static]

Definition at line 55 of file glue_int.cpp.

                                               {
    return arg_1 / arg_2;
  }
static list<generic> mmx::GLUE_10 ( const generic arg_1,
const list< generic > &  arg_2 
) [static]

Definition at line 54 of file glue_list_generic.cpp.

References cons().

                                                             {
    return cons (arg_1, arg_2);
  }
static bool mmx::GLUE_10 ( const port arg_1) [static]

Definition at line 54 of file glue_port.cpp.

References is_input_port().

                              {
    return is_input_port (arg_1);
  }
static alias<vector<routine> > mmx::GLUE_10 ( const alias< vector< routine > > &  arg_1,
const vector< routine > &  arg_2 
) [static]

Definition at line 55 of file glue_routine.cpp.

References alias_write().

                                                                               {
    return alias_write (arg_1, arg_2);
  }
static bool mmx::GLUE_10 ( const string arg_1,
const string arg_2 
) [static]

Definition at line 54 of file glue_string.cpp.

References starts().

                                                     {
    return starts (arg_1, arg_2);
  }
static syntactic mmx::GLUE_10 ( const syntactic arg_1,
const syntactic arg_2 
) [static]

Definition at line 52 of file glue_syntactic.cpp.

                                                           {
    return arg_1 / arg_2;
  }
static bool mmx::GLUE_10 ( const table< generic, generic > &  arg_1,
const tuple< generic > &  arg_2 
) [static]

Definition at line 54 of file glue_table_generic.cpp.

References as_vector(), and contains().

                                                                              {
    return contains (arg_1, as_vector (arg_2));
  }
static document mmx::GLUE_11 ( const tuple< document > &  arg_1) [static]
static double mmx::GLUE_11 ( const double &  arg_1,
const double &  arg_2 
) [static]

Definition at line 60 of file glue_double.cpp.

                                                     {
    return arg_1 * arg_2;
  }
static int mmx::GLUE_11 ( const int &  arg_1,
const int &  arg_2 
) [static]

Definition at line 60 of file glue_int.cpp.

References quo().

                                               {
    return quo (arg_1, arg_2);
  }
static generic mmx::GLUE_11 ( const list< generic > &  arg_1) [static]

Definition at line 59 of file glue_list_generic.cpp.

References car().

                                       {
    return car (arg_1);
  }
static bool mmx::GLUE_11 ( const port arg_1) [static]

Definition at line 59 of file glue_port.cpp.

References error_flag().

                              {
    return error_flag (arg_1);
  }
static vector<routine> mmx::GLUE_11 ( const routine arg_1,
const vector< routine > &  arg_2 
) [static]

Definition at line 60 of file glue_routine.cpp.

References cons().

                                                               {
    return cons (arg_1, arg_2);
  }
static bool mmx::GLUE_11 ( const string arg_1,
const string arg_2 
) [static]

Definition at line 59 of file glue_string.cpp.

References ends().

                                                     {
    return ends (arg_1, arg_2);
  }
static syntactic mmx::GLUE_11 ( const syntactic arg_1,
const syntactic arg_2 
) [static]

Definition at line 57 of file glue_syntactic.cpp.

References pow().

                                                           {
    return pow (arg_1, arg_2);
  }
static generic mmx::GLUE_11 ( const table< generic, generic > &  arg_1,
const tuple< generic > &  arg_2 
) [static]

Definition at line 59 of file glue_table_generic.cpp.

References as_vector().

                                                                              {
    return arg_1[as_vector (arg_2)];
  }
static alias<vector<generic> > mmx::GLUE_11 ( const alias< vector< generic > > &  arg_1,
const vector< generic > &  arg_2 
) [static]

Definition at line 59 of file glue_vector_generic.cpp.

References alias_write().

                                                                               {
    return alias_write (arg_1, arg_2);
  }
static int mmx::GLUE_12 ( const int &  arg_1,
const int &  arg_2 
) [static]

Definition at line 65 of file glue_int.cpp.

References rem().

                                               {
    return rem (arg_1, arg_2);
  }
static list<generic> mmx::GLUE_12 ( const list< generic > &  arg_1) [static]

Definition at line 64 of file glue_list_generic.cpp.

References cdr().

                                       {
    return cdr (arg_1);
  }
static string mmx::GLUE_12 ( const port arg_1) [static]

Definition at line 64 of file glue_port.cpp.

References error_message().

                              {
    return error_message (arg_1);
  }
static routine mmx::GLUE_12 ( const vector< routine > &  arg_1) [static]

Definition at line 65 of file glue_routine.cpp.

References car().

                                         {
    return car (arg_1);
  }
static string mmx::GLUE_12 ( const string arg_1,
const string arg_2,
const string arg_3 
) [static]

Definition at line 64 of file glue_string.cpp.

References replace().

                                                                          {
    return replace (arg_1, arg_2, arg_3);
  }
static vector<generic> mmx::GLUE_12 ( const generic arg_1,
const vector< generic > &  arg_2 
) [static]

Definition at line 64 of file glue_vector_generic.cpp.

References cons().

                                                               {
    return cons (arg_1, arg_2);
  }
static double mmx::GLUE_12 ( const double &  arg_1,
const double &  arg_2 
) [static]

Definition at line 65 of file glue_double.cpp.

                                                     {
    return arg_1 / arg_2;
  }
static alias<generic> mmx::GLUE_12 ( const alias< table< generic, generic > > &  arg_1,
const tuple< generic > &  arg_2 
) [static]

Definition at line 64 of file glue_table_generic.cpp.

References as_vector().

                                                                                      {
    return alias_access<generic > (arg_1, as_vector (arg_2));
  }
static document mmx::GLUE_12 ( const tuple< document > &  arg_1) [static]
static double mmx::GLUE_13 ( const double &  arg_1) [static]

Definition at line 70 of file glue_double.cpp.

References mmx_sqrt.

                                {
    return mmx_sqrt (arg_1);
  }
static bool mmx::GLUE_13 ( const int &  arg_1,
const int &  arg_2 
) [static]

Definition at line 70 of file glue_int.cpp.

References divides().

                                               {
    return divides (arg_1, arg_2);
  }
static bool mmx::GLUE_13 ( const list< generic > &  arg_1) [static]

Definition at line 69 of file glue_list_generic.cpp.

References is_nil().

                                       {
    return is_nil (arg_1);
  }
static vector<routine> mmx::GLUE_13 ( const vector< routine > &  arg_1) [static]

Definition at line 70 of file glue_routine.cpp.

References cdr().

                                         {
    return cdr (arg_1);
  }
static int mmx::GLUE_13 ( const string arg_1,
const string arg_2,
const int &  arg_3 
) [static]

Definition at line 69 of file glue_string.cpp.

References search_forwards().

                                                                       {
    return search_forwards (arg_1, arg_2, arg_3);
  }
static void mmx::GLUE_13 ( const alias< table< generic, generic > > &  arg_1,
const tuple< generic > &  arg_2 
) [static]

Definition at line 69 of file glue_table_generic.cpp.

References alias_reset(), and as_vector().

                                                                                      {
    alias_reset (arg_1, as_vector (arg_2));
  }
static generic mmx::GLUE_13 ( const vector< generic > &  arg_1) [static]

Definition at line 69 of file glue_vector_generic.cpp.

References car().

                                         {
    return car (arg_1);
  }
static bool mmx::GLUE_13 ( const port arg_1) [static]

Definition at line 69 of file glue_port.cpp.

References busy().

                              {
    return busy (arg_1);
  }
static document mmx::GLUE_13 ( const tuple< document > &  arg_1) [static]
static vector<generic> mmx::GLUE_14 ( const vector< generic > &  arg_1) [static]

Definition at line 74 of file glue_vector_generic.cpp.

References cdr().

                                         {
    return cdr (arg_1);
  }
static double mmx::GLUE_14 ( const double &  arg_1,
const double &  arg_2 
) [static]

Definition at line 75 of file glue_double.cpp.

References mmx_pow.

Referenced by glue_double(), glue_int(), glue_list_generic(), glue_port(), glue_routine(), glue_string(), glue_table_generic(), and glue_vector_generic().

                                                     {
    return mmx_pow (arg_1, arg_2);
  }
static bool mmx::GLUE_14 ( const list< generic > &  arg_1) [static]

Definition at line 74 of file glue_list_generic.cpp.

References is_atom().

                                       {
    return is_atom (arg_1);
  }
static int mmx::GLUE_14 ( const port arg_1) [static]

Definition at line 74 of file glue_port.cpp.

References can_write().

                              {
    return can_write (arg_1);
  }
static bool mmx::GLUE_14 ( const vector< routine > &  arg_1) [static]

Definition at line 75 of file glue_routine.cpp.

References is_nil().

                                         {
    return is_nil (arg_1);
  }
static int mmx::GLUE_14 ( const string arg_1,
const string arg_2,
const int &  arg_3 
) [static]

Definition at line 74 of file glue_string.cpp.

References search_backwards().

                                                                       {
    return search_backwards (arg_1, arg_2, arg_3);
  }
static bool mmx::GLUE_14 ( const int &  arg_1,
const int &  arg_2 
) [static]

Definition at line 75 of file glue_int.cpp.

                                               {
    return arg_1 < arg_2;
  }
static void mmx::GLUE_14 ( const table< generic, generic > &  arg_1,
const tuple< generic > &  arg_2,
const generic arg_3 
) [static]

Definition at line 74 of file glue_table_generic.cpp.

References as_vector(), and inside_set().

                                                                                                    {
    inside_set (arg_1, as_vector (arg_2), arg_3);
  }
static bool mmx::GLUE_15 ( const vector< generic > &  arg_1) [static]

Definition at line 79 of file glue_vector_generic.cpp.

References is_nil().

                                         {
    return is_nil (arg_1);
  }
static list<generic> mmx::GLUE_15 ( const list< generic > &  arg_1,
const generic arg_2 
) [static]

Definition at line 79 of file glue_list_generic.cpp.

References insert().

                                                             {
    return insert (arg_1, arg_2);
  }
static double mmx::GLUE_15 ( const double &  arg_1) [static]

Definition at line 80 of file glue_double.cpp.

References mmx_exp.

Referenced by glue_double(), glue_int(), glue_list_generic(), glue_port(), glue_routine(), glue_string(), and glue_vector_generic().

                                {
    return mmx_exp (arg_1);
  }
static bool mmx::GLUE_15 ( const int &  arg_1,
const int &  arg_2 
) [static]

Definition at line 80 of file glue_int.cpp.

                                               {
    return arg_1 <= arg_2;
  }
static string mmx::GLUE_15 ( const string arg_1) [static]

Definition at line 79 of file glue_string.cpp.

References upcase().

                                {
    return upcase (arg_1);
  }
static bool mmx::GLUE_15 ( const vector< routine > &  arg_1) [static]

Definition at line 80 of file glue_routine.cpp.

References is_atom().

                                         {
    return is_atom (arg_1);
  }
static int mmx::GLUE_15 ( const port arg_1) [static]

Definition at line 79 of file glue_port.cpp.

References can_read().

                              {
    return can_read (arg_1);
  }
static bool mmx::GLUE_16 ( const int &  arg_1,
const int &  arg_2 
) [static]

Definition at line 85 of file glue_int.cpp.

                                               {
    return arg_1 > arg_2;
  }
static int mmx::GLUE_16 ( const list< generic > &  arg_1,
const generic arg_2 
) [static]

Definition at line 84 of file glue_list_generic.cpp.

References find().

                                                             {
    return find (arg_1, arg_2);
  }
static void mmx::GLUE_16 ( const port arg_1,
const string arg_2 
) [static]

Definition at line 84 of file glue_port.cpp.

References write().

                                                   {
    write (arg_1, arg_2);
  }
static vector<routine> mmx::GLUE_16 ( const vector< routine > &  arg_1,
const routine arg_2 
) [static]

Definition at line 85 of file glue_routine.cpp.

References insert().

                                                               {
    return insert (arg_1, arg_2);
  }
static string mmx::GLUE_16 ( const string arg_1) [static]

Definition at line 84 of file glue_string.cpp.

References locase().

                                {
    return locase (arg_1);
  }
static bool mmx::GLUE_16 ( const vector< generic > &  arg_1) [static]

Definition at line 84 of file glue_vector_generic.cpp.

References is_atom().

                                         {
    return is_atom (arg_1);
  }
static double mmx::GLUE_16 ( const double &  arg_1) [static]

Definition at line 85 of file glue_double.cpp.

References mmx_log.

Referenced by glue_double(), glue_int(), glue_list_generic(), glue_port(), glue_routine(), glue_string(), and glue_vector_generic().

                                {
    return mmx_log (arg_1);
  }
static string mmx::GLUE_17 ( const port arg_1,
const int &  arg_2 
) [static]

Definition at line 89 of file glue_port.cpp.

References read().

                                                {
    return read (arg_1, arg_2);
  }
static double mmx::GLUE_17 ( const double &  arg_1) [static]

Definition at line 90 of file glue_double.cpp.

References mmx_cos.

Referenced by glue_double(), glue_int(), glue_list_generic(), glue_port(), glue_routine(), glue_string(), and glue_vector_generic().

                                {
    return mmx_cos (arg_1);
  }
static bool mmx::GLUE_17 ( const int &  arg_1,
const int &  arg_2 
) [static]

Definition at line 90 of file glue_int.cpp.

                                               {
    return arg_1 >= arg_2;
  }
static bool mmx::GLUE_17 ( const list< generic > &  arg_1,
const generic arg_2 
) [static]

Definition at line 89 of file glue_list_generic.cpp.

References contains().

                                                             {
    return contains (arg_1, arg_2);
  }
static string mmx::GLUE_17 ( const string arg_1) [static]

Definition at line 89 of file glue_string.cpp.

References upcase_first().

                                {
    return upcase_first (arg_1);
  }
static vector<generic> mmx::GLUE_17 ( const vector< generic > &  arg_1,
const generic arg_2 
) [static]

Definition at line 89 of file glue_vector_generic.cpp.

References insert().

                                                               {
    return insert (arg_1, arg_2);
  }
static int mmx::GLUE_17 ( const vector< routine > &  arg_1,
const routine arg_2 
) [static]

Definition at line 90 of file glue_routine.cpp.

References find().

                                                               {
    return find (arg_1, arg_2);
  }
static void mmx::GLUE_18 ( const port arg_1) [static]

Definition at line 94 of file glue_port.cpp.

References flush().

                              {
    flush (arg_1);
  }
static bool mmx::GLUE_18 ( const vector< routine > &  arg_1,
const routine arg_2 
) [static]

Definition at line 95 of file glue_routine.cpp.

References contains().

                                                               {
    return contains (arg_1, arg_2);
  }
static int mmx::GLUE_18 ( const vector< generic > &  arg_1,
const generic arg_2 
) [static]

Definition at line 94 of file glue_vector_generic.cpp.

References find().

                                                               {
    return find (arg_1, arg_2);
  }
static string mmx::GLUE_18 ( const string arg_1) [static]

Definition at line 94 of file glue_string.cpp.

References locase_first().

                                {
    return locase_first (arg_1);
  }
static int mmx::GLUE_18 ( const int &  arg_1) [static]

Definition at line 95 of file glue_int.cpp.

References abs().

                             {
    return abs (arg_1);
  }
static double mmx::GLUE_18 ( const double &  arg_1) [static]

Definition at line 95 of file glue_double.cpp.

References mmx_sin.

Referenced by glue_double(), glue_int(), glue_port(), glue_routine(), glue_string(), and glue_vector_generic().

                                {
    return mmx_sin (arg_1);
  }
static double mmx::GLUE_19 ( const double &  arg_1) [static]

Definition at line 100 of file glue_double.cpp.

References mmx_tan.

Referenced by glue_double(), glue_int(), glue_port(), glue_routine(), glue_string(), and glue_vector_generic().

                                {
    return mmx_tan (arg_1);
  }
static int mmx::GLUE_19 ( const int &  arg_1,
const int &  arg_2 
) [static]

Definition at line 100 of file glue_int.cpp.

References min().

                                               {
    return min (arg_1, arg_2);
  }
static bool mmx::GLUE_19 ( const port arg_1,
const int &  arg_2 
) [static]

Definition at line 99 of file glue_port.cpp.

References wait().

                                                {
    return wait (arg_1, arg_2);
  }
static vector<generic> mmx::GLUE_19 ( const vector< routine > &  arg_1) [static]

Definition at line 100 of file glue_routine.cpp.

                                         {
    return as<vector<generic> > (arg_1);
  }
static bool mmx::GLUE_19 ( const vector< generic > &  arg_1,
const generic arg_2 
) [static]

Definition at line 99 of file glue_vector_generic.cpp.

References contains().

                                                               {
    return contains (arg_1, arg_2);
  }
static string mmx::GLUE_19 ( const string arg_1) [static]

Definition at line 99 of file glue_string.cpp.

References quote().

                                {
    return quote (arg_1);
  }
static document mmx::GLUE_2 ( const document arg_1) [static]

Definition at line 22 of file glue_document.cpp.

                                 {
    return document (arg_1);
  }
static generic mmx::GLUE_2 ( const dynamic arg_1) [static]

Definition at line 14 of file glue_dynamic.cpp.

References contents().

                                {
    return contents (arg_1);
  }
static int mmx::GLUE_2 ( const string arg_1) [static]

Definition at line 15 of file glue_int.cpp.

References as_int().

                               {
    return as_int (arg_1);
  }
static vector<routine> mmx::GLUE_2 ( const tuple< routine > &  arg_1) [static]

Definition at line 15 of file glue_routine.cpp.

References as_vector().

                                       {
    return vector<routine > (as_vector (arg_1));
  }
static string mmx::GLUE_2 ( const string arg_1,
const int &  arg_2,
const int &  arg_3 
) [static]

Definition at line 14 of file glue_string.cpp.

                                                                   {
    return arg_1 (arg_2, arg_3);
  }
static generic mmx::GLUE_2 ( const syntactic arg_1) [static]

Definition at line 12 of file glue_syntactic.cpp.

References as_generic().

                                  {
    return as_generic (arg_1);
  }
static table<generic, generic> mmx::GLUE_2 ( const generic arg_1) [static]

Definition at line 14 of file glue_table_generic.cpp.

                                {
    return table<generic, generic > (arg_1);
  }
static double mmx::GLUE_2 ( const int &  arg_1) [static]

Definition at line 15 of file glue_double.cpp.

                            {
    return double (arg_1);
  }
static int mmx::GLUE_20 ( const int &  arg_1,
const int &  arg_2 
) [static]

Definition at line 105 of file glue_int.cpp.

References max().

                                               {
    return max (arg_1, arg_2);
  }
static port mmx::GLUE_20 ( const port arg_1) [static]

Definition at line 104 of file glue_port.cpp.

References accept().

                              {
    return accept (arg_1);
  }
static string mmx::GLUE_20 ( const string arg_1) [static]

Definition at line 104 of file glue_string.cpp.

References unquote().

                                {
    return unquote (arg_1);
  }
static vector<generic> mmx::GLUE_20 ( const vector< generic > &  arg_1) [static]

Definition at line 104 of file glue_vector_generic.cpp.

                                         {
    return -arg_1;
  }
static double mmx::GLUE_20 ( const double &  arg_1) [static]

Definition at line 105 of file glue_double.cpp.

References mmx_acos.

Referenced by glue_double(), glue_int(), glue_port(), glue_string(), and glue_vector_generic().

                                {
    return mmx_acos (arg_1);
  }
static double mmx::GLUE_21 ( const double &  arg_1) [static]

Definition at line 110 of file glue_double.cpp.

References mmx_asin.

Referenced by glue_double(), glue_int(), glue_port(), and glue_vector_generic().

                                {
    return mmx_asin (arg_1);
  }
static int mmx::GLUE_21 ( ) [static]

Definition at line 110 of file glue_int.cpp.

             {
    return rand ();
  }
static vector<generic> mmx::GLUE_21 ( const vector< generic > &  arg_1) [static]

Definition at line 109 of file glue_vector_generic.cpp.

References square().

                                         {
    return square (arg_1);
  }
static port mmx::GLUE_21 ( const port arg_1,
const string arg_2 
) [static]

Definition at line 109 of file glue_port.cpp.

References component().

                                                   {
    return component (arg_1, arg_2);
  }
static double mmx::GLUE_22 ( const double &  arg_1) [static]

Definition at line 115 of file glue_double.cpp.

References mmx_atan.

Referenced by glue_double(), glue_port(), and glue_vector_generic().

                                {
    return mmx_atan (arg_1);
  }
static int mmx::GLUE_22 ( const int &  arg_1) [static]

Definition at line 114 of file glue_port.cpp.

References wait_port_event().

                             {
    return wait_port_event (arg_1);
  }
static vector<generic> mmx::GLUE_22 ( const vector< generic > &  arg_1,
const vector< generic > &  arg_2 
) [static]

Definition at line 114 of file glue_vector_generic.cpp.

                                                                       {
    return arg_1 + arg_2;
  }
static bool mmx::GLUE_23 ( const double &  arg_1,
const double &  arg_2 
) [static]

Definition at line 120 of file glue_double.cpp.

Referenced by glue_double(), glue_port(), and glue_vector_generic().

                                                     {
    return arg_1 < arg_2;
  }
static port mmx::GLUE_23 ( const port arg_1,
const generic arg_2 
) [static]

Definition at line 119 of file glue_port.cpp.

                                                    {
    return arg_1 << arg_2;
  }
static vector<generic> mmx::GLUE_23 ( const vector< generic > &  arg_1,
const vector< generic > &  arg_2 
) [static]

Definition at line 119 of file glue_vector_generic.cpp.

                                                                       {
    return arg_1 - arg_2;
  }
static bool mmx::GLUE_24 ( const double &  arg_1,
const double &  arg_2 
) [static]

Definition at line 125 of file glue_double.cpp.

Referenced by glue_double(), glue_port(), and glue_vector_generic().

                                                     {
    return arg_1 <= arg_2;
  }
static port mmx::GLUE_24 ( const port arg_1,
const string arg_2 
) [static]

Definition at line 124 of file glue_port.cpp.

                                                   {
    return arg_1 << arg_2;
  }
static vector<generic> mmx::GLUE_24 ( const vector< generic > &  arg_1,
const vector< generic > &  arg_2 
) [static]

Definition at line 124 of file glue_vector_generic.cpp.

                                                                       {
    return arg_1 * arg_2;
  }
static bool mmx::GLUE_25 ( const double &  arg_1,
const double &  arg_2 
) [static]

Definition at line 130 of file glue_double.cpp.

Referenced by glue_double(), glue_port(), and glue_vector_generic().

                                                     {
    return arg_1 > arg_2;
  }
static generic mmx::GLUE_25 ( const vector< generic > &  arg_1,
const vector< generic > &  arg_2 
) [static]

Definition at line 129 of file glue_vector_generic.cpp.

References dot().

                                                                       {
    return dot (arg_1, arg_2);
  }
static generic mmx::GLUE_25 ( const generic arg_1) [static]

Definition at line 129 of file glue_port.cpp.

References generic_assemble().

                                 {
    return generic_assemble (arg_1);
  }
static bool mmx::GLUE_26 ( const double &  arg_1,
const double &  arg_2 
) [static]

Definition at line 135 of file glue_double.cpp.

Referenced by glue_double(), glue_port(), and glue_vector_generic().

                                                     {
    return arg_1 >= arg_2;
  }
static generic mmx::GLUE_26 ( const generic arg_1) [static]

Definition at line 134 of file glue_port.cpp.

References generic_disassemble().

                                 {
    return generic_disassemble (arg_1);
  }
static generic mmx::GLUE_26 ( const vector< generic > &  arg_1) [static]

Definition at line 134 of file glue_vector_generic.cpp.

References big_mul().

                                         {
    return big_mul (arg_1);
  }
static generic mmx::GLUE_27 ( const vector< generic > &  arg_1) [static]

Definition at line 139 of file glue_vector_generic.cpp.

References big_add().

                                         {
    return big_add (arg_1);
  }
static double mmx::GLUE_27 ( const double &  arg_1) [static]

Definition at line 140 of file glue_double.cpp.

References abs().

Referenced by glue_double(), glue_port(), and glue_vector_generic().

                                {
    return abs (arg_1);
  }
static void mmx::GLUE_27 ( const port arg_1,
const generic arg_2 
) [static]

Definition at line 139 of file glue_port.cpp.

References binary_write_generic().

                                                    {
    binary_write_generic (arg_1, arg_2);
  }
static generic mmx::GLUE_28 ( const port arg_1) [static]

Definition at line 144 of file glue_port.cpp.

References binary_read_generic().

                              {
    return binary_read_generic (arg_1);
  }
static double mmx::GLUE_28 ( const double &  arg_1,
const double &  arg_2 
) [static]

Definition at line 145 of file glue_double.cpp.

References min().

Referenced by glue_double(), glue_port(), and glue_vector_generic().

                                                     {
    return min (arg_1, arg_2);
  }
static vector<generic> mmx::GLUE_28 ( const vector< generic > &  arg_1,
const vector< generic > &  arg_2 
) [static]

Definition at line 144 of file glue_vector_generic.cpp.

                                                                       {
    return arg_1 / arg_2;
  }
static double mmx::GLUE_29 ( const double &  arg_1,
const double &  arg_2 
) [static]

Definition at line 150 of file glue_double.cpp.

References max().

Referenced by glue_double(), and glue_vector_generic().

                                                     {
    return max (arg_1, arg_2);
  }
static bool mmx::GLUE_29 ( const vector< generic > &  arg_1,
const vector< generic > &  arg_2 
) [static]

Definition at line 149 of file glue_vector_generic.cpp.

                                                                       {
    return arg_1 <= arg_2;
  }
static generic mmx::GLUE_3 ( const document arg_1) [static]

Definition at line 27 of file glue_document.cpp.

References as_generic().

                                 {
    return as_generic (arg_1);
  }
static dynamic mmx::GLUE_3 ( const routine arg_1,
const tuple< dynamic > &  arg_2 
) [static]

Definition at line 19 of file glue_dynamic.cpp.

References as_vector().

                                                             {
    return dynamic (arg_1, as_vector (arg_2));
  }
static string mmx::GLUE_3 ( const int &  arg_1) [static]

Definition at line 20 of file glue_int.cpp.

References as_string().

                            {
    return as_string (arg_1);
  }
static string mmx::GLUE_3 ( const literal arg_1) [static]

Definition at line 24 of file glue_literal.cpp.

                                {
    return *arg_1;
  }
static port mmx::GLUE_3 ( const string arg_1) [static]

Definition at line 19 of file glue_port.cpp.

References output_file_port().

                               {
    return output_file_port (arg_1);
  }
static iterator<generic> mmx::GLUE_3 ( const vector< routine > &  arg_1) [static]

Definition at line 20 of file glue_routine.cpp.

References iterate().

                                        {
    return as<iterator<generic> > (iterate (arg_1));
  }
static string mmx::GLUE_3 ( const syntactic arg_1) [static]

Definition at line 17 of file glue_syntactic.cpp.

References as_string().

                                  {
    return as_string (arg_1);
  }
static iterator<generic> mmx::GLUE_3 ( const table< generic, generic > &  arg_1) [static]

Definition at line 19 of file glue_table_generic.cpp.

References entries().

                                                {
    return entries (arg_1);
  }
static vector<generic> mmx::GLUE_3 ( const tuple< generic > &  arg_1) [static]

Definition at line 19 of file glue_vector_generic.cpp.

References as_vector().

                                       {
    return vector<generic > (as_vector (arg_1));
  }
static string mmx::GLUE_3 ( const string arg_1,
const string arg_2 
) [static]

Definition at line 19 of file glue_string.cpp.

                                                    {
    return arg_1 * arg_2;
  }
static iterator<generic> mmx::GLUE_3 ( const list< generic > &  arg_1) [static]

Definition at line 19 of file glue_list_generic.cpp.

References iterate().

                                      {
    return iterate (arg_1);
  }
static int mmx::GLUE_3 ( const double &  arg_1) [static]

Definition at line 20 of file glue_double.cpp.

References as_int().

                               {
    return as_int (arg_1);
  }
static double mmx::GLUE_30 ( const double &  arg_1) [static]

Definition at line 155 of file glue_double.cpp.

References mmx_floor.

Referenced by glue_double(), and glue_vector_generic().

                                {
    return mmx_floor (arg_1);
  }
static bool mmx::GLUE_30 ( const vector< generic > &  arg_1,
const vector< generic > &  arg_2 
) [static]

Definition at line 154 of file glue_vector_generic.cpp.

                                                                       {
    return arg_1 >= arg_2;
  }
static double mmx::GLUE_31 ( const double &  arg_1) [static]

Definition at line 160 of file glue_double.cpp.

References mmx_ceil.

Referenced by glue_double(), and glue_vector_generic().

                                {
    return mmx_ceil (arg_1);
  }
static bool mmx::GLUE_31 ( const vector< generic > &  arg_1,
const vector< generic > &  arg_2 
) [static]

Definition at line 159 of file glue_vector_generic.cpp.

                                                                       {
    return arg_1 < arg_2;
  }
static bool mmx::GLUE_32 ( const vector< generic > &  arg_1,
const vector< generic > &  arg_2 
) [static]

Definition at line 164 of file glue_vector_generic.cpp.

                                                                       {
    return arg_1 > arg_2;
  }
static double mmx::GLUE_32 ( const double &  arg_1) [static]

Definition at line 165 of file glue_double.cpp.

References mmx_trunc.

Referenced by glue_double(), and glue_vector_generic().

                                {
    return mmx_trunc (arg_1);
  }
static double mmx::GLUE_33 ( const double &  arg_1) [static]

Definition at line 170 of file glue_double.cpp.

References mmx_round.

Referenced by glue_double(), and glue_vector_generic().

                                {
    return mmx_round (arg_1);
  }
static vector<generic> mmx::GLUE_33 ( const vector< generic > &  arg_1) [static]

Definition at line 169 of file glue_vector_generic.cpp.

References sqrt().

                                         {
    return sqrt (arg_1);
  }
static bool mmx::GLUE_34 ( const double &  arg_1) [static]

Definition at line 175 of file glue_double.cpp.

References is_finite().

Referenced by glue_double(), and glue_vector_generic().

                                {
    return is_finite (arg_1);
  }
static vector<generic> mmx::GLUE_34 ( const vector< generic > &  arg_1) [static]

Definition at line 174 of file glue_vector_generic.cpp.

References exp().

                                         {
    return exp (arg_1);
  }
static bool mmx::GLUE_35 ( const double &  arg_1) [static]

Definition at line 180 of file glue_double.cpp.

References is_infinite().

Referenced by glue_double(), and glue_vector_generic().

                                {
    return is_infinite (arg_1);
  }
static vector<generic> mmx::GLUE_35 ( const vector< generic > &  arg_1) [static]

Definition at line 179 of file glue_vector_generic.cpp.

References log().

                                         {
    return log (arg_1);
  }
static vector<generic> mmx::GLUE_36 ( const vector< generic > &  arg_1,
const vector< generic > &  arg_2 
) [static]

Definition at line 184 of file glue_vector_generic.cpp.

References pow().

                                                                       {
    return pow (arg_1, arg_2);
  }
static bool mmx::GLUE_36 ( const double &  arg_1) [static]

Definition at line 185 of file glue_double.cpp.

References is_nan().

Referenced by glue_double(), and glue_vector_generic().

                                {
    return is_nan (arg_1);
  }
static double mmx::GLUE_37 ( const double &  arg_1) [static]

Definition at line 190 of file glue_double.cpp.

References times_infinity().

Referenced by glue_double(), and glue_vector_generic().

                                {
    return times_infinity (arg_1);
  }
static vector<generic> mmx::GLUE_37 ( const vector< generic > &  arg_1) [static]

Definition at line 189 of file glue_vector_generic.cpp.

References cos().

                                         {
    return cos (arg_1);
  }
static int mmx::GLUE_38 ( const double &  arg_1) [static]

Definition at line 195 of file glue_double.cpp.

References precision().

Referenced by glue_double(), and glue_vector_generic().

                                {
    return precision (arg_1);
  }
static vector<generic> mmx::GLUE_38 ( const vector< generic > &  arg_1) [static]

Definition at line 194 of file glue_vector_generic.cpp.

References sin().

                                         {
    return sin (arg_1);
  }
static double mmx::GLUE_39 ( const double &  arg_1) [static]

Definition at line 200 of file glue_double.cpp.

References next_above().

Referenced by glue_double(), and glue_vector_generic().

                                {
    return next_above (arg_1);
  }
static vector<generic> mmx::GLUE_39 ( const vector< generic > &  arg_1) [static]

Definition at line 199 of file glue_vector_generic.cpp.

References tan().

                                         {
    return tan (arg_1);
  }
static syntactic mmx::GLUE_4 ( const generic arg_1) [static]

Definition at line 22 of file glue_syntactic.cpp.

References flatten().

                                {
    return flatten (arg_1);
  }
static void mmx::GLUE_4 ( const dynamic arg_1,
const generic arg_2 
) [static]

Definition at line 24 of file glue_dynamic.cpp.

References assign().

                                                      {
    assign (arg_1, arg_2);
  }
static string mmx::GLUE_4 ( const int &  arg_1) [static]

Definition at line 25 of file glue_int.cpp.

References as_string_hexa().

                            {
    return as_string_hexa (arg_1);
  }
static int mmx::GLUE_4 ( const list< generic > &  arg_1) [static]

Definition at line 24 of file glue_list_generic.cpp.

References N().

                                      {
    return N (arg_1);
  }
static generic mmx::GLUE_4 ( const literal arg_1,
const tuple< generic > &  arg_2 
) [static]

Definition at line 29 of file glue_literal.cpp.

References as_vector(), and literal_apply.

                                                             {
    return literal_apply (arg_1, as_vector (arg_2));
  }
static port mmx::GLUE_4 ( const string arg_1,
const int &  arg_2 
) [static]

Definition at line 24 of file glue_port.cpp.

References socket_server_port().

                                                 {
    return socket_server_port (arg_1, arg_2);
  }
static int mmx::GLUE_4 ( const vector< routine > &  arg_1) [static]

Definition at line 25 of file glue_routine.cpp.

References N().

                                        {
    return N (arg_1);
  }
static string mmx::GLUE_4 ( const string arg_1,
const string arg_2 
) [static]

Definition at line 24 of file glue_string.cpp.

                                                    {
    return arg_1 * arg_2;
  }
static document mmx::GLUE_4 ( const string arg_1) [static]

Definition at line 32 of file glue_document.cpp.

                               {
    return document (arg_1);
  }
static iterator<generic> mmx::GLUE_4 ( const vector< generic > &  arg_1) [static]

Definition at line 24 of file glue_vector_generic.cpp.

References iterate().

                                        {
    return iterate (arg_1);
  }
static int mmx::GLUE_4 ( const table< generic, generic > &  arg_1) [static]

Definition at line 24 of file glue_table_generic.cpp.

References N().

                                                {
    return N (arg_1);
  }
static double mmx::GLUE_40 ( const double &  arg_1) [static]

Definition at line 205 of file glue_double.cpp.

References next_below().

Referenced by glue_double(), and glue_vector_generic().

                                {
    return next_below (arg_1);
  }
static vector<generic> mmx::GLUE_40 ( const vector< generic > &  arg_1) [static]

Definition at line 204 of file glue_vector_generic.cpp.

References acos().

                                         {
    return acos (arg_1);
  }
static int mmx::GLUE_41 ( const double &  arg_1) [static]

Definition at line 210 of file glue_double.cpp.

References exponent().

Referenced by glue_double(), and glue_vector_generic().

                                {
    return exponent (arg_1);
  }
static vector<generic> mmx::GLUE_41 ( const vector< generic > &  arg_1) [static]

Definition at line 209 of file glue_vector_generic.cpp.

References asin().

                                         {
    return asin (arg_1);
  }
static vector<generic> mmx::GLUE_42 ( const vector< generic > &  arg_1) [static]

Definition at line 214 of file glue_vector_generic.cpp.

References atan().

                                         {
    return atan (arg_1);
  }
static double mmx::GLUE_42 ( const double &  arg_1) [static]

Definition at line 215 of file glue_double.cpp.

References magnitude().

Referenced by glue_double(), and glue_vector_generic().

                                {
    return magnitude (arg_1);
  }
static double mmx::GLUE_43 ( const double &  arg_1,
const int &  arg_2 
) [static]

Definition at line 220 of file glue_double.cpp.

References incexp2().

Referenced by glue_double(), and glue_vector_generic().

                                                  {
    return incexp2 (arg_1, arg_2);
  }
static vector<generic> mmx::GLUE_43 ( const vector< generic > &  arg_1) [static]

Definition at line 219 of file glue_vector_generic.cpp.

References derive().

                                         {
    return derive (arg_1);
  }
static vector<generic> mmx::GLUE_44 ( const vector< generic > &  arg_1) [static]

Definition at line 224 of file glue_vector_generic.cpp.

References integrate().

                                         {
    return integrate (arg_1);
  }
static double mmx::GLUE_44 ( const double &  arg_1,
const int &  arg_2 
) [static]

Definition at line 225 of file glue_double.cpp.

References decexp2().

Referenced by glue_double(), and glue_vector_generic().

                                                  {
    return decexp2 (arg_1, arg_2);
  }
static double mmx::GLUE_45 ( const double &  arg_1) [static]

Definition at line 230 of file glue_double.cpp.

References rounding_error().

Referenced by glue_double().

                                {
    return rounding_error (arg_1);
  }
static double mmx::GLUE_46 ( const double &  arg_1) [static]

Definition at line 235 of file glue_double.cpp.

References additive_error().

Referenced by glue_double().

                                {
    return additive_error (arg_1);
  }
static double mmx::GLUE_47 ( const double &  arg_1) [static]

Definition at line 240 of file glue_double.cpp.

References multiplicative_error().

Referenced by glue_double().

                                {
    return multiplicative_error (arg_1);
  }
static double mmx::GLUE_48 ( const double &  arg_1) [static]

Definition at line 245 of file glue_double.cpp.

References elementary_error().

Referenced by glue_double().

                                {
    return elementary_error (arg_1);
  }
static routine mmx::GLUE_5 ( const vector< routine > &  arg_1,
const int &  arg_2 
) [static]

Definition at line 30 of file glue_routine.cpp.

                                                          {
    return arg_1[arg_2];
  }
static port mmx::GLUE_5 ( const string arg_1,
const int &  arg_2 
) [static]

Definition at line 29 of file glue_port.cpp.

References socket_client_port().

                                                 {
    return socket_client_port (arg_1, arg_2);
  }
static generic mmx::GLUE_5 ( const literal arg_1,
const tuple< generic > &  arg_2 
) [static]

Definition at line 34 of file glue_literal.cpp.

References as_vector(), and literal_access.

                                                             {
    return literal_access (arg_1, as_vector (arg_2));
  }
static int mmx::GLUE_5 ( const compound arg_1) [static]
static document mmx::GLUE_5 ( const string arg_1,
const tuple< document > &  arg_2 
) [static]

Definition at line 37 of file glue_document.cpp.

References as_vector(), and make_texmacs().

                                                             {
    return make_texmacs (arg_1, as_vector (arg_2));
  }
static string mmx::GLUE_5 ( const double &  arg_1) [static]

Definition at line 30 of file glue_double.cpp.

References as_string().

                               {
    return as_string (arg_1);
  }
static int mmx::GLUE_5 ( const int &  arg_1) [static]

Definition at line 30 of file glue_int.cpp.

                            {
    return -arg_1;
  }
static generic mmx::GLUE_5 ( const list< generic > &  arg_1,
const int &  arg_2 
) [static]

Definition at line 29 of file glue_list_generic.cpp.

                                                        {
    return arg_1[arg_2];
  }
static alias<string> mmx::GLUE_5 ( const alias< string > &  arg_1,
const string arg_2 
) [static]

Definition at line 29 of file glue_string.cpp.

References alias_write().

                                                           {
    return alias_write (arg_1, arg_2);
  }
static syntactic mmx::GLUE_5 ( const syntactic arg_1) [static]

Definition at line 27 of file glue_syntactic.cpp.

                                  {
    return -arg_1;
  }
static int mmx::GLUE_5 ( const vector< generic > &  arg_1) [static]

Definition at line 29 of file glue_vector_generic.cpp.

References N().

                                        {
    return N (arg_1);
  }
static bool mmx::GLUE_5 ( const table< generic, generic > &  arg_1,
const generic arg_2 
) [static]

Definition at line 29 of file glue_table_generic.cpp.

References contains().

                                                                      {
    return contains (arg_1, arg_2);
  }
static document mmx::GLUE_6 ( const literal arg_1,
const tuple< document > &  arg_2 
) [static]

Definition at line 42 of file glue_document.cpp.

References as_vector(), and make_texmacs().

                                                              {
    return make_texmacs (arg_1, as_vector (arg_2));
  }
static double mmx::GLUE_6 ( const double &  arg_1,
const double &  arg_2 
) [static]

Definition at line 35 of file glue_double.cpp.

References uniform_deviate().

                                                    {
    return uniform_deviate (arg_1, arg_2);
  }
static alias<generic> mmx::GLUE_6 ( const alias< list< generic > > &  arg_1,
const int &  arg_2 
) [static]

Definition at line 34 of file glue_list_generic.cpp.

                                                                {
    return alias_access<generic > (arg_1, arg_2);
  }
static port mmx::GLUE_6 ( const string arg_1) [static]

Definition at line 34 of file glue_port.cpp.

References pipe_port().

                               {
    return pipe_port (arg_1);
  }
static alias<routine> mmx::GLUE_6 ( const alias< vector< routine > > &  arg_1,
const int &  arg_2 
) [static]

Definition at line 35 of file glue_routine.cpp.

                                                                  {
    return alias_access<routine > (arg_1, arg_2);
  }
static bool mmx::GLUE_6 ( const string arg_1,
const string arg_2 
) [static]

Definition at line 34 of file glue_string.cpp.

                                                    {
    return arg_1 < arg_2;
  }
static syntactic mmx::GLUE_6 ( const syntactic arg_1) [static]

Definition at line 32 of file glue_syntactic.cpp.

References square().

                                  {
    return square (arg_1);
  }
static generic mmx::GLUE_6 ( const vector< generic > &  arg_1,
const int &  arg_2 
) [static]

Definition at line 34 of file glue_vector_generic.cpp.

                                                          {
    return arg_1[arg_2];
  }
static int mmx::GLUE_6 ( const int &  arg_1) [static]

Definition at line 35 of file glue_int.cpp.

References square().

                            {
    return square (arg_1);
  }
static generic mmx::GLUE_6 ( const compound arg_1,
const int &  arg_2 
) [static]
static generic mmx::GLUE_6 ( const table< generic, generic > &  arg_1,
const generic arg_2 
) [static]

Definition at line 34 of file glue_table_generic.cpp.

                                                                      {
    return arg_1[arg_2];
  }
static vector<generic> mmx::GLUE_7 ( const compound arg_1) [static]
static document mmx::GLUE_7 ( const generic arg_1) [static]

Definition at line 47 of file glue_document.cpp.

References make_text().

                                {
    return make_text (arg_1);
  }
static double mmx::GLUE_7 ( const double &  arg_1) [static]

Definition at line 40 of file glue_double.cpp.

                               {
    return -arg_1;
  }
static list<generic> mmx::GLUE_7 ( const list< generic > &  arg_1,
const int &  arg_2,
const int &  arg_3 
) [static]

Definition at line 39 of file glue_list_generic.cpp.

References range().

                                                                          {
    return range (arg_1, arg_2, arg_3);
  }
static int mmx::GLUE_7 ( const int &  arg_1,
const int &  arg_2 
) [static]

Definition at line 40 of file glue_int.cpp.

                                              {
    return arg_1 + arg_2;
  }
static port mmx::GLUE_7 ( const tuple< port > &  arg_1) [static]

Definition at line 39 of file glue_port.cpp.

References as_vector(), and composite_port().

                                    {
    return composite_port (as_vector (arg_1));
  }
static vector<routine> mmx::GLUE_7 ( const vector< routine > &  arg_1,
const int &  arg_2,
const int &  arg_3 
) [static]

Definition at line 40 of file glue_routine.cpp.

References range().

                                                                            {
    return range (arg_1, arg_2, arg_3);
  }
static syntactic mmx::GLUE_7 ( const syntactic arg_1,
const syntactic arg_2 
) [static]

Definition at line 37 of file glue_syntactic.cpp.

                                                          {
    return arg_1 + arg_2;
  }
static alias<generic> mmx::GLUE_7 ( const alias< table< generic, generic > > &  arg_1,
const generic arg_2 
) [static]

Definition at line 39 of file glue_table_generic.cpp.

                                                                              {
    return alias_access<generic > (arg_1, arg_2);
  }
static alias<generic> mmx::GLUE_7 ( const alias< vector< generic > > &  arg_1,
const int &  arg_2 
) [static]

Definition at line 39 of file glue_vector_generic.cpp.

                                                                  {
    return alias_access<generic > (arg_1, arg_2);
  }
static bool mmx::GLUE_7 ( const string arg_1,
const string arg_2 
) [static]

Definition at line 39 of file glue_string.cpp.

                                                    {
    return arg_1 <= arg_2;
  }
static double mmx::GLUE_8 ( const double &  arg_1) [static]

Definition at line 45 of file glue_double.cpp.

References square().

                               {
    return square (arg_1);
  }
static int mmx::GLUE_8 ( const int &  arg_1,
const int &  arg_2 
) [static]

Definition at line 45 of file glue_int.cpp.

                                              {
    return arg_1 - arg_2;
  }
static list<generic> mmx::GLUE_8 ( const list< generic > &  arg_1) [static]

Definition at line 44 of file glue_list_generic.cpp.

References reverse().

                                      {
    return reverse (arg_1);
  }
static port mmx::GLUE_8 ( const string arg_1) [static]

Definition at line 44 of file glue_port.cpp.

References error_port().

                               {
    return error_port (arg_1);
  }
static vector<routine> mmx::GLUE_8 ( const vector< routine > &  arg_1) [static]

Definition at line 45 of file glue_routine.cpp.

References reverse().

                                        {
    return reverse (arg_1);
  }
static void mmx::GLUE_8 ( const alias< table< generic, generic > > &  arg_1,
const generic arg_2 
) [static]

Definition at line 44 of file glue_table_generic.cpp.

References alias_reset().

                                                                              {
    alias_reset (arg_1, arg_2);
  }
static bool mmx::GLUE_8 ( const string arg_1,
const string arg_2 
) [static]

Definition at line 44 of file glue_string.cpp.

                                                    {
    return arg_1 > arg_2;
  }
static vector<generic> mmx::GLUE_8 ( const vector< generic > &  arg_1,
const int &  arg_2,
const int &  arg_3 
) [static]

Definition at line 44 of file glue_vector_generic.cpp.

References range().

                                                                            {
    return range (arg_1, arg_2, arg_3);
  }
static syntactic mmx::GLUE_8 ( const syntactic arg_1,
const syntactic arg_2 
) [static]

Definition at line 42 of file glue_syntactic.cpp.

                                                          {
    return arg_1 - arg_2;
  }
static document mmx::GLUE_8 ( const document arg_1) [static]

Definition at line 52 of file glue_document.cpp.

References make_text().

                                 {
    return make_text (arg_1);
  }
static void mmx::GLUE_9 ( const table< generic, generic > &  arg_1,
const generic arg_2,
const generic arg_3 
) [static]

Definition at line 49 of file glue_table_generic.cpp.

References inside_set().

                                                                                            {
    inside_set (arg_1, arg_2, arg_3);
  }
static bool mmx::GLUE_9 ( const port arg_1) [static]

Definition at line 49 of file glue_port.cpp.

References is_output_port().

                             {
    return is_output_port (arg_1);
  }
static document mmx::GLUE_9 ( const generic arg_1) [static]

Definition at line 57 of file glue_document.cpp.

References make_math().

                                {
    return make_math (arg_1);
  }
static double mmx::GLUE_9 ( const double &  arg_1,
const double &  arg_2 
) [static]

Definition at line 50 of file glue_double.cpp.

                                                    {
    return arg_1 + arg_2;
  }
static int mmx::GLUE_9 ( const int &  arg_1,
const int &  arg_2 
) [static]

Definition at line 50 of file glue_int.cpp.

                                              {
    return arg_1 * arg_2;
  }
static bool mmx::GLUE_9 ( const string arg_1,
const string arg_2 
) [static]

Definition at line 49 of file glue_string.cpp.

                                                    {
    return arg_1 >= arg_2;
  }
static syntactic mmx::GLUE_9 ( const syntactic arg_1,
const syntactic arg_2 
) [static]

Definition at line 47 of file glue_syntactic.cpp.

                                                          {
    return arg_1 * arg_2;
  }
static vector<routine> mmx::GLUE_9 ( const vector< routine > &  arg_1,
const vector< routine > &  arg_2 
) [static]

Definition at line 50 of file glue_routine.cpp.

References append().

                                                                      {
    return append (arg_1, arg_2);
  }
static vector<generic> mmx::GLUE_9 ( const vector< generic > &  arg_1) [static]

Definition at line 49 of file glue_vector_generic.cpp.

References reverse().

                                        {
    return reverse (arg_1);
  }
static list<generic> mmx::GLUE_9 ( const list< generic > &  arg_1,
const list< generic > &  arg_2 
) [static]

Definition at line 49 of file glue_list_generic.cpp.

References append().

                                                                  {
    return append (arg_1, arg_2);
  }
static generic mmx::GLUE_9 ( const compound arg_1,
const tuple< generic > &  arg_2 
) [static]
void mmx::glue_basix ( )

Definition at line 24 of file glue_basix.cpp.

References done(), glue_compound(), glue_document(), glue_double(), glue_dynamic(), glue_generic(), glue_int(), glue_list_generic(), glue_list_map(), glue_literal(), glue_port(), glue_routine(), glue_string(), glue_syntactic(), glue_table_generic(), glue_vector_generic(), glue_vector_map(), and register_glue().

                {
    static bool done = false;
    if (done) return;
    done = true;
    register_glue (string ("glue_compound"), (& (glue_compound)));
    register_glue (string ("glue_document"), (& (glue_document)));
    register_glue (string ("glue_double"), (& (glue_double)));
    register_glue (string ("glue_dynamic"), (& (glue_dynamic)));
    register_glue (string ("glue_generic"), (& (glue_generic)));
    register_glue (string ("glue_int"), (& (glue_int)));
    register_glue (string ("glue_list_generic"), (& (glue_list_generic)));
    register_glue (string ("glue_list_map"), (& (glue_list_map)));
    register_glue (string ("glue_literal"), (& (glue_literal)));
    register_glue (string ("glue_port"), (& (glue_port)));
    register_glue (string ("glue_routine"), (& (glue_routine)));
    register_glue (string ("glue_string"), (& (glue_string)));
    register_glue (string ("glue_syntactic"), (& (glue_syntactic)));
    register_glue (string ("glue_table_generic"), (& (glue_table_generic)));
    register_glue (string ("glue_vector_generic"), (& (glue_vector_generic)));
    register_glue (string ("glue_vector_map"), (& (glue_vector_map)));
    register_glue (string ("glue_basix"), (& (glue_basix)));
    glue_compound ();
    glue_document ();
    glue_double ();
    glue_dynamic ();
    glue_generic ();
    glue_int ();
    glue_list_generic ();
    glue_list_map ();
    glue_literal ();
    glue_port ();
    glue_routine ();
    glue_string ();
    glue_syntactic ();
    glue_table_generic ();
    glue_vector_generic ();
    glue_vector_map ();
  }
void glue_compound ( )

Definition at line 61 of file glue_compound.cpp.

References call_glue(), define(), done(), GLUE_1(), GLUE_2(), GLUE_3(), GLUE_4(), GLUE_5(), GLUE_6(), GLUE_7(), GLUE_8(), and GLUE_9().

Referenced by glue_basix().

                   {
    static bool done = false;
    if (done) return;
    done = true;
    call_glue (string ("glue_vector_generic"));
    define ("compound?", GLUE_1);
    define ("compound", GLUE_2);
    define ("as_compound", GLUE_3);
    define ("as_vector", GLUE_4);
    define ("#", GLUE_5);
    define (".[]", GLUE_6);
    define ("components", GLUE_7);
    define ("arguments", GLUE_8);
    define (".()", GLUE_9);
  }
void glue_document ( )

Definition at line 82 of file glue_document.cpp.

References call_glue(), define(), define_converter(), done(), GLUE_1(), GLUE_10(), GLUE_11(), GLUE_12(), GLUE_13(), GLUE_2(), GLUE_3(), GLUE_4(), GLUE_5(), GLUE_6(), GLUE_7(), GLUE_8(), GLUE_9(), lit(), and PENALTY_INCLUSION.

Referenced by glue_basix().

                   {
    static bool done = false;
    if (done) return;
    done = true;
    call_glue (string ("glue_literal"));
    define_type<document > (lit ("Document"));
    define ("document", GLUE_1);
    define ("document", GLUE_2);
    define ("as_generic", GLUE_3);
    define_converter ("upgrade", GLUE_4, PENALTY_INCLUSION);
    define ("$tm", GLUE_5);
    define ("$tm", GLUE_6);
    define ("$text", GLUE_7);
    define ("$text", GLUE_8);
    define ("$math", GLUE_9);
    define ("$math", GLUE_10);
    define ("$inline", GLUE_11);
    define ("$block", GLUE_12);
    define ("(.)", GLUE_13);
  }
void glue_double ( )

Definition at line 250 of file glue_double.cpp.

References define(), define_converter(), done(), GLUE_1(), GLUE_10(), GLUE_11(), GLUE_12(), GLUE_13(), GLUE_14(), GLUE_15(), GLUE_16(), GLUE_17(), GLUE_18(), GLUE_19(), GLUE_2(), GLUE_20(), GLUE_21(), GLUE_22(), GLUE_23(), GLUE_24(), GLUE_25(), GLUE_26(), GLUE_27(), GLUE_28(), GLUE_29(), GLUE_3(), GLUE_30(), GLUE_31(), GLUE_32(), GLUE_33(), GLUE_34(), GLUE_35(), GLUE_36(), GLUE_37(), GLUE_38(), GLUE_39(), GLUE_4(), GLUE_40(), GLUE_41(), GLUE_42(), GLUE_43(), GLUE_44(), GLUE_45(), GLUE_46(), GLUE_47(), GLUE_48(), GLUE_5(), GLUE_6(), GLUE_7(), GLUE_8(), GLUE_9(), lit(), and PENALTY_INCLUSION.

Referenced by glue_basix().

                 {
    static bool done = false;
    if (done) return;
    done = true;
    define_type<double > (lit ("Double"));
    define ("literal_floating", GLUE_1);
    define_converter ("upgrade", GLUE_2, PENALTY_INCLUSION);
    define ("as_int", GLUE_3);
    define ("as_double", GLUE_4);
    define ("as_string", GLUE_5);
    define ("uniform_deviate", GLUE_6);
    define ("-", GLUE_7);
    define ("square", GLUE_8);
    define ("+", GLUE_9);
    define ("-", GLUE_10);
    define ("*", GLUE_11);
    define ("/", GLUE_12);
    define ("sqrt", GLUE_13);
    define ("^", GLUE_14);
    define ("exp", GLUE_15);
    define ("log", GLUE_16);
    define ("cos", GLUE_17);
    define ("sin", GLUE_18);
    define ("tan", GLUE_19);
    define ("arccos", GLUE_20);
    define ("arcsin", GLUE_21);
    define ("arctan", GLUE_22);
    define ("<", GLUE_23);
    define ("<=", GLUE_24);
    define (">", GLUE_25);
    define (">=", GLUE_26);
    define ("abs", GLUE_27);
    define ("min", GLUE_28);
    define ("max", GLUE_29);
    define ("floor", GLUE_30);
    define ("ceil", GLUE_31);
    define ("trunc", GLUE_32);
    define ("round", GLUE_33);
    define ("finite?", GLUE_34);
    define ("infinite?", GLUE_35);
    define ("nan?", GLUE_36);
    define ("times_infinity", GLUE_37);
    define ("precision", GLUE_38);
    define ("next_above", GLUE_39);
    define ("next_below", GLUE_40);
    define ("exponent", GLUE_41);
    define ("magnitude", GLUE_42);
    define ("increase_exponent", GLUE_43);
    define ("decrease_exponent", GLUE_44);
    define ("rounding_error", GLUE_45);
    define ("additive_error", GLUE_46);
    define ("multiplicative_error", GLUE_47);
    define ("elementary_error", GLUE_48);
  }
void glue_dynamic ( )

Definition at line 29 of file glue_dynamic.cpp.

References define(), done(), GLUE_1(), GLUE_2(), GLUE_3(), GLUE_4(), and lit().

Referenced by glue_basix().

                  {
    static bool done = false;
    if (done) return;
    done = true;
    define_type<dynamic > (lit ("Dynamic"));
    define ("dynamic", GLUE_1);
    define ("contents", GLUE_2);
    define ("apply", GLUE_3);
    define ("assign", GLUE_4);
  }
void glue_generic ( )

Definition at line 6 of file glue_generic.cpp.

References done().

Referenced by glue_basix().

                  {
    static bool done = false;
    if (done) return;
    done = true;
  }
void glue_int ( )

Definition at line 115 of file glue_int.cpp.

References define(), done(), GLUE_1(), GLUE_10(), GLUE_11(), GLUE_12(), GLUE_13(), GLUE_14(), GLUE_15(), GLUE_16(), GLUE_17(), GLUE_18(), GLUE_19(), GLUE_2(), GLUE_20(), GLUE_21(), GLUE_3(), GLUE_4(), GLUE_5(), GLUE_6(), GLUE_7(), GLUE_8(), GLUE_9(), and lit().

Referenced by glue_basix().

              {
    static bool done = false;
    if (done) return;
    done = true;
    define_type<int > (lit ("Int"));
    define ("literal_integer", GLUE_1);
    define ("as_int", GLUE_2);
    define ("as_string", GLUE_3);
    define ("as_string_hexa", GLUE_4);
    define ("-", GLUE_5);
    define ("square", GLUE_6);
    define ("+", GLUE_7);
    define ("-", GLUE_8);
    define ("*", GLUE_9);
    define ("div", GLUE_10);
    define ("quo", GLUE_11);
    define ("rem", GLUE_12);
    define ("divides?", GLUE_13);
    define ("<", GLUE_14);
    define ("<=", GLUE_15);
    define (">", GLUE_16);
    define (">=", GLUE_17);
    define ("abs", GLUE_18);
    define ("min", GLUE_19);
    define ("max", GLUE_20);
    define ("random", GLUE_21);
  }
void glue_list_generic ( )

Definition at line 94 of file glue_list_generic.cpp.

References call_glue(), define(), define_converter(), done(), gen(), GLUE_1(), GLUE_10(), GLUE_11(), GLUE_12(), GLUE_13(), GLUE_14(), GLUE_15(), GLUE_16(), GLUE_17(), GLUE_2(), GLUE_3(), GLUE_4(), GLUE_5(), GLUE_6(), GLUE_7(), GLUE_8(), GLUE_9(), lit(), and PENALTY_PROMOTE_GENERIC.

Referenced by glue_basix().

                       {
    static bool done = false;
    if (done) return;
    done = true;
    call_glue (string ("glue_generic"));
    define_type<list<generic> > (gen (lit ("List"), lit ("Generic")));
    define ("list?", GLUE_1);
    define ("list", GLUE_2);
    define_converter (":>", GLUE_3, PENALTY_PROMOTE_GENERIC);
    define ("#", GLUE_4);
    define (".[]", GLUE_5);
    define (".[]", GLUE_6);
    define (".[]", GLUE_7);
    define ("reverse", GLUE_8);
    define ("><", GLUE_9);
    define ("cons", GLUE_10);
    define ("car", GLUE_11);
    define ("cdr", GLUE_12);
    define ("nil?", GLUE_13);
    define ("atom?", GLUE_14);
    define ("insert", GLUE_15);
    define ("find", GLUE_16);
    define ("contains?", GLUE_17);
  }
void glue_list_map ( )

Definition at line 160 of file glue_list_map.cpp.

References call_glue(), define(), done(), list_append_several(), list_apply(), list_foreach(), list_map(), list_sort(), and register_glue().

Referenced by glue_basix().

                 {
  static bool done = false;
  if (done) return;
  done = true;
  register_glue ("glue_list_map", &glue_list_map);
  call_glue ("glue_list_generic");
  define ("map", list_map);
  define ("foreach", list_foreach);
  define ("append", list_append_several);
  define ("apply", list_apply);
  define ("sort", list_sort);
  //define ("filter", list_filter);
  //define ("find_index", list_find_index);
}
void glue_literal ( )

Definition at line 39 of file glue_literal.cpp.

References call_glue(), define(), done(), GLUE_1(), GLUE_2(), GLUE_3(), GLUE_4(), and GLUE_5().

Referenced by glue_basix().

                  {
    static bool done = false;
    if (done) return;
    done = true;
    call_glue (string ("glue_string"));
    define ("literal?", GLUE_1);
    define ("as_literal", GLUE_2);
    define ("as_string", GLUE_3);
    define (".()", GLUE_4);
    define (".[]", GLUE_5);
  }
void glue_port ( )

Definition at line 149 of file glue_port.cpp.

References call_glue(), define(), done(), GLUE_1(), GLUE_10(), GLUE_11(), GLUE_12(), GLUE_13(), GLUE_14(), GLUE_15(), GLUE_16(), GLUE_17(), GLUE_18(), GLUE_19(), GLUE_2(), GLUE_20(), GLUE_21(), GLUE_22(), GLUE_23(), GLUE_24(), GLUE_25(), GLUE_26(), GLUE_27(), GLUE_28(), GLUE_3(), GLUE_4(), GLUE_5(), GLUE_6(), GLUE_7(), GLUE_8(), GLUE_9(), lit(), mmerr, mmin, and mmout.

Referenced by glue_basix().

               {
    static bool done = false;
    if (done) return;
    done = true;
    call_glue (string ("glue_string"));
    define_type<port > (lit ("Port"));
    define_constant<port > ("mmin", mmin);
    define_constant<port > ("mmout", mmout);
    define_constant<port > ("mmerr", mmerr);
    define ("input_string_port", GLUE_1);
    define ("input_file_port", GLUE_2);
    define ("output_file_port", GLUE_3);
    define ("socket_server_port", GLUE_4);
    define ("socket_client_port", GLUE_5);
    define ("pipe_port", GLUE_6);
    define ("composite_port", GLUE_7);
    define ("error_port", GLUE_8);
    define (".output_port?", GLUE_9);
    define (".input_port?", GLUE_10);
    define (".error?", GLUE_11);
    define (".error", GLUE_12);
    define (".busy?", GLUE_13);
    define (".can_write", GLUE_14);
    define (".can_read", GLUE_15);
    define ("write", GLUE_16);
    define ("read", GLUE_17);
    define ("flush", GLUE_18);
    define ("wait", GLUE_19);
    define ("accept", GLUE_20);
    define (".[]", GLUE_21);
    define ("wait", GLUE_22);
    define ("<<", GLUE_23);
    define ("<<", GLUE_24);
    define ("binary_assemble", GLUE_25);
    define ("binary_disassemble", GLUE_26);
    define ("binary_write", GLUE_27);
    define ("binary_read", GLUE_28);
  }
void glue_routine ( )

Definition at line 105 of file glue_routine.cpp.

References call_glue(), define(), define_converter(), done(), gen(), GLUE_1(), GLUE_10(), GLUE_11(), GLUE_12(), GLUE_13(), GLUE_14(), GLUE_15(), GLUE_16(), GLUE_17(), GLUE_18(), GLUE_19(), GLUE_2(), GLUE_3(), GLUE_4(), GLUE_5(), GLUE_6(), GLUE_7(), GLUE_8(), GLUE_9(), lit(), PENALTY_CAST, and PENALTY_PROMOTE_GENERIC.

Referenced by glue_basix().

                  {
    static bool done = false;
    if (done) return;
    done = true;
    call_glue (string ("glue_vector_generic"));
    define_type<vector<routine> > (gen (lit ("Vector"), lit ("Routine")));
    define ("vector", GLUE_1);
    define ("[]", GLUE_2);
    define_converter (":>", GLUE_3, PENALTY_CAST);
    define ("#", GLUE_4);
    define (".[]", GLUE_5);
    define (".[]", GLUE_6);
    define (".[]", GLUE_7);
    define ("reverse", GLUE_8);
    define ("><", GLUE_9);
    define ("<<", GLUE_10);
    define ("cons", GLUE_11);
    define ("car", GLUE_12);
    define ("cdr", GLUE_13);
    define ("nil?", GLUE_14);
    define ("atom?", GLUE_15);
    define ("insert", GLUE_16);
    define ("find", GLUE_17);
    define ("contains?", GLUE_18);
    define_converter (":>", GLUE_19, PENALTY_PROMOTE_GENERIC);
  }
void glue_string ( )

Definition at line 109 of file glue_string.cpp.

References call_glue(), define(), done(), GLUE_1(), GLUE_10(), GLUE_11(), GLUE_12(), GLUE_13(), GLUE_14(), GLUE_15(), GLUE_16(), GLUE_17(), GLUE_18(), GLUE_19(), GLUE_2(), GLUE_20(), GLUE_3(), GLUE_4(), GLUE_5(), GLUE_6(), GLUE_7(), GLUE_8(), and GLUE_9().

Referenced by glue_basix().

                 {
    static bool done = false;
    if (done) return;
    done = true;
    call_glue (string ("glue_vector_generic"));
    define ("#", GLUE_1);
    define (".[]", GLUE_2);
    define ("*", GLUE_3);
    define ("><", GLUE_4);
    define ("<<", GLUE_5);
    define ("<", GLUE_6);
    define ("<=", GLUE_7);
    define (">", GLUE_8);
    define (">=", GLUE_9);
    define ("starts?", GLUE_10);
    define ("ends?", GLUE_11);
    define ("replace", GLUE_12);
    define ("search_forwards", GLUE_13);
    define ("search_backwards", GLUE_14);
    define ("upcase", GLUE_15);
    define ("locase", GLUE_16);
    define ("upcase_first", GLUE_17);
    define ("locase_first", GLUE_18);
    define ("quote", GLUE_19);
    define ("unquote", GLUE_20);
  }
void glue_syntactic ( )

Definition at line 62 of file glue_syntactic.cpp.

References define(), done(), GLUE_1(), GLUE_10(), GLUE_11(), GLUE_2(), GLUE_3(), GLUE_4(), GLUE_5(), GLUE_6(), GLUE_7(), GLUE_8(), GLUE_9(), and lit().

Referenced by glue_basix().

                    {
    static bool done = false;
    if (done) return;
    done = true;
    define_type<syntactic > (lit ("Syntactic"));
    define ("syntactic", GLUE_1);
    define ("as_generic", GLUE_2);
    define ("as_string", GLUE_3);
    define ("flatten", GLUE_4);
    define ("-", GLUE_5);
    define ("square", GLUE_6);
    define ("+", GLUE_7);
    define ("-", GLUE_8);
    define ("*", GLUE_9);
    define ("/", GLUE_10);
    define ("^", GLUE_11);
  }
void glue_table_generic ( )

Definition at line 79 of file glue_table_generic.cpp.

References call_glue(), define(), define_converter(), done(), gen(), GLUE_1(), GLUE_10(), GLUE_11(), GLUE_12(), GLUE_13(), GLUE_14(), GLUE_2(), GLUE_3(), GLUE_4(), GLUE_5(), GLUE_6(), GLUE_7(), GLUE_8(), GLUE_9(), lit(), and PENALTY_PROMOTE_GENERIC.

Referenced by glue_basix().

                        {
    static bool done = false;
    if (done) return;
    done = true;
    call_glue (string ("glue_generic"));
    define_type<table<generic, generic> > (gen (lit ("Table"), lit ("Generic"), lit ("Generic")));
    define ("table?", GLUE_1);
    define ("table", GLUE_2);
    define_converter (":>", GLUE_3, PENALTY_PROMOTE_GENERIC);
    define ("#", GLUE_4);
    define ("contains?", GLUE_5);
    define (".[]", GLUE_6);
    define (".[]", GLUE_7);
    define ("reset", GLUE_8);
    define ("set", GLUE_9);
    define ("contains?", GLUE_10);
    define (".[]", GLUE_11);
    define (".[]", GLUE_12);
    define ("reset", GLUE_13);
    define ("set", GLUE_14);
  }
void glue_vector_generic ( )

Definition at line 229 of file glue_vector_generic.cpp.

References call_glue(), define(), define_converter(), done(), gen(), GLUE_1(), GLUE_10(), GLUE_11(), GLUE_12(), GLUE_13(), GLUE_14(), GLUE_15(), GLUE_16(), GLUE_17(), GLUE_18(), GLUE_19(), GLUE_2(), GLUE_20(), GLUE_21(), GLUE_22(), GLUE_23(), GLUE_24(), GLUE_25(), GLUE_26(), GLUE_27(), GLUE_28(), GLUE_29(), GLUE_3(), GLUE_30(), GLUE_31(), GLUE_32(), GLUE_33(), GLUE_34(), GLUE_35(), GLUE_36(), GLUE_37(), GLUE_38(), GLUE_39(), GLUE_4(), GLUE_40(), GLUE_41(), GLUE_42(), GLUE_43(), GLUE_44(), GLUE_5(), GLUE_6(), GLUE_7(), GLUE_8(), GLUE_9(), lit(), and PENALTY_PROMOTE_GENERIC.

Referenced by glue_basix().

                         {
    static bool done = false;
    if (done) return;
    done = true;
    call_glue (string ("glue_generic"));
    define_type<vector<generic> > (gen (lit ("Vector"), lit ("Generic")));
    define ("vector?", GLUE_1);
    define ("vector", GLUE_2);
    define ("[]", GLUE_3);
    define_converter (":>", GLUE_4, PENALTY_PROMOTE_GENERIC);
    define ("#", GLUE_5);
    define (".[]", GLUE_6);
    define (".[]", GLUE_7);
    define (".[]", GLUE_8);
    define ("reverse", GLUE_9);
    define ("><", GLUE_10);
    define ("<<", GLUE_11);
    define ("cons", GLUE_12);
    define ("car", GLUE_13);
    define ("cdr", GLUE_14);
    define ("nil?", GLUE_15);
    define ("atom?", GLUE_16);
    define ("insert", GLUE_17);
    define ("find", GLUE_18);
    define ("contains?", GLUE_19);
    define ("-", GLUE_20);
    define ("square", GLUE_21);
    define ("+", GLUE_22);
    define ("-", GLUE_23);
    define ("*", GLUE_24);
    define ("dot", GLUE_25);
    define ("big_mul", GLUE_26);
    define ("big_add", GLUE_27);
    define ("/", GLUE_28);
    define ("<=", GLUE_29);
    define (">=", GLUE_30);
    define ("<", GLUE_31);
    define (">", GLUE_32);
    define ("sqrt", GLUE_33);
    define ("exp", GLUE_34);
    define ("log", GLUE_35);
    define ("^", GLUE_36);
    define ("cos", GLUE_37);
    define ("sin", GLUE_38);
    define ("tan", GLUE_39);
    define ("arccos", GLUE_40);
    define ("arcsin", GLUE_41);
    define ("arctan", GLUE_42);
    define ("derive", GLUE_43);
    define ("integrate", GLUE_44);
  }
void glue_vector_map ( )

Definition at line 163 of file glue_vector_map.cpp.

References call_glue(), define(), done(), register_glue(), vector_append_several(), vector_apply(), vector_foreach(), vector_map(), vector_sort(), and vector_sort_leq().

Referenced by glue_basix().

                   {
  static bool done = false;
  if (done) return;
  done = true;
  register_glue ("glue_vector_map", &glue_vector_map);
  call_glue ("glue_vector_generic");
  define ("map", vector_map);
  define ("foreach", vector_foreach);
  define ("append", vector_append_several);
  define ("apply", vector_apply);
  define ("sort", vector_sort);
  define ("sort", vector_sort_leq);
}
bool mmx::gtr_operator ( const T &  x,
const T &  y 
)

Definition at line 38 of file operators.hpp.

{ return x>y; }
bool mmx::gtreq_operator ( const T &  x,
const T &  y 
)

Definition at line 39 of file operators.hpp.

{ return x>=y; }
bool mmx::hard_eq ( const compound c1,
const compound c2 
) [inline]

Definition at line 55 of file compound.hpp.

References as_vector(), and hard_eq().

                                                             {
  return hard_eq (as_vector (c1), as_vector (c2)); }
bool mmx::hard_eq ( const document c1,
const document c2 
) [inline]

Definition at line 59 of file document.hpp.

References hard_eq().

                                                             {
  return hard_eq (*c1, *c2); }
bool mmx::hard_eq ( const exception &  e1,
const exception &  e2 
) [inline]

Definition at line 47 of file exception.hpp.

References hard_eq().

                                                               {
  return hard_eq (*e1, *e2); }
bool mmx::hard_eq ( const syntactic &  c1,
const syntactic &  c2 
) [inline]

Definition at line 62 of file syntactic.hpp.

References hard_eq().

                                                               {
  return hard_eq (*c1, *c2); }
bool mmx::hard_eq ( const function_0< D > &  f,
const function_0< D > &  g 
) [inline]

Definition at line 97 of file function.hpp.

                                                                {
  return (f.rep) == (g.rep); }
bool mmx::hard_eq ( const function_1< D, S1 > &  f,
const function_1< D, S1 > &  g 
) [inline]

Definition at line 146 of file function.hpp.

                                                                {
  return (f.rep) == (g.rep); }
bool mmx::hard_eq ( const function_2< D, S1, S2 > &  f,
const function_2< D, S1, S2 > &  g 
) [inline]

Definition at line 239 of file function.hpp.

                                                                {
  return (f.rep) == (g.rep); }
bool mmx::hard_eq ( const list< C > &  x,
const list< C > &  y 
) [inline]

Definition at line 127 of file list.hpp.

                                                        {
  return (x.operator -> ()) == (y.operator -> ()); }
bool mmx::hard_eq ( const function_3< D, S1, S2, S3 > &  f,
const function_3< D, S1, S2, S3 > &  g 
) [inline]

Definition at line 291 of file function.hpp.

                                                                {
  return (f.rep) == (g.rep); }
bool mmx::hard_eq ( const C &  x,
const C &  y 
) [inline]
bool mmx::hard_eq ( const function_4< D, S1, S2, S3, S4 > &  f,
const function_4< D, S1, S2, S3, S4 > &  g 
) [inline]

Definition at line 343 of file function.hpp.

                                                                {
  return (f.rep) == (g.rep); }
bool mmx::hard_eq ( const function_5< D, S1, S2, S3, S4, S5 > &  f,
const function_5< D, S1, S2, S3, S4, S5 > &  g 
) [inline]

Definition at line 395 of file function.hpp.

                                                                {
  return (f.rep) == (g.rep); }
bool mmx::hard_eq ( const literal c1,
const literal c2 
) [inline]

Definition at line 52 of file literal.hpp.

References as_string(), and hard_eq().

                                                           {
  return hard_eq (as_string (c1), as_string (c2)); }
bool mmx::hard_eq ( const function_6< D, S1, S2, S3, S4, S5, S6 > &  f,
const function_6< D, S1, S2, S3, S4, S5, S6 > &  g 
) [inline]

Definition at line 447 of file function.hpp.

                                                                {
  return (f.rep) == (g.rep); }
bool mmx::hard_eq ( const chain< C > &  x,
const chain< C > &  y 
) [inline]

Definition at line 118 of file chain.hpp.

                                                          {
  return (x.operator -> ()) == (y.operator -> ()); }
bool mmx::hard_eq ( const function_7< D, S1, S2, S3, S4, S5, S6, S7 > &  f,
const function_7< D, S1, S2, S3, S4, S5, S6, S7 > &  g 
) [inline]

Definition at line 499 of file function.hpp.

                                                                {
  return (f.rep) == (g.rep); }
bool mmx::hard_eq ( const function_8< D, S1, S2, S3, S4, S5, S6, S7, S8 > &  f,
const function_8< D, S1, S2, S3, S4, S5, S6, S7, S8 > &  g 
) [inline]

Definition at line 551 of file function.hpp.

                                                                {
  return (f.rep) == (g.rep); }
bool mmx::hard_gtr ( const C &  x,
const C &  y 
) [inline]

Definition at line 165 of file basix.hpp.

References inside().

Referenced by hard_gtr_op::op().

                                                                   {
  return ((void*) inside (x)) > ((void*) inside (y)); }
nat mmx::hard_hash ( const compound c) [inline]

Definition at line 45 of file compound.hpp.

References as_vector(), and hard_hash().

                                         {
  return hard_hash (as_vector (c)); }
nat mmx::hard_hash ( const document c) [inline]

Definition at line 50 of file document.hpp.

References hard_hash().

{ return hard_hash (*c); }
nat mmx::hard_hash ( const exception &  e) [inline]

Definition at line 38 of file exception.hpp.

References hard_hash().

{ return hard_hash (*e); }
nat mmx::hard_hash ( const function_0< D > &  f) [inline]

Definition at line 95 of file function.hpp.

References as_hash().

                                              {
  return as_hash (f.rep); }
nat mmx::hard_hash ( const chain< C > &  x) [inline]

Definition at line 116 of file chain.hpp.

References as_hash().

                                           {
  return as_hash (x.operator -> ()); }
nat mmx::hard_hash ( const function_1< D, S1 > &  f) [inline]

Definition at line 144 of file function.hpp.

References as_hash().

                                              {
  return as_hash (f.rep); }
nat mmx::hard_hash ( const function_2< D, S1, S2 > &  f) [inline]

Definition at line 237 of file function.hpp.

References as_hash().

                                              {
  return as_hash (f.rep); }
nat mmx::hard_hash ( const list< C > &  x) [inline]

Definition at line 125 of file list.hpp.

References as_hash().

                                          {
  return as_hash (x.operator -> ()); }
nat mmx::hard_hash ( const function_3< D, S1, S2, S3 > &  f) [inline]

Definition at line 289 of file function.hpp.

References as_hash().

                                              {
  return as_hash (f.rep); }
nat mmx::hard_hash ( const function_4< D, S1, S2, S3, S4 > &  f) [inline]

Definition at line 341 of file function.hpp.

References as_hash().

                                              {
  return as_hash (f.rep); }
nat mmx::hard_hash ( const function_5< D, S1, S2, S3, S4, S5 > &  f) [inline]

Definition at line 393 of file function.hpp.

References as_hash().

                                              {
  return as_hash (f.rep); }
nat mmx::hard_hash ( const literal c) [inline]

Definition at line 43 of file literal.hpp.

References as_string(), and hard_hash().

{ return hard_hash (as_string (c)); }
nat mmx::hard_hash ( const function_6< D, S1, S2, S3, S4, S5, S6 > &  f) [inline]

Definition at line 445 of file function.hpp.

References as_hash().

                                              {
  return as_hash (f.rep); }
nat mmx::hard_hash ( const function_7< D, S1, S2, S3, S4, S5, S6, S7 > &  f) [inline]

Definition at line 497 of file function.hpp.

References as_hash().

                                              {
  return as_hash (f.rep); }
nat mmx::hard_hash ( const function_8< D, S1, S2, S3, S4, S5, S6, S7, S8 > &  f) [inline]

Definition at line 549 of file function.hpp.

References as_hash().

                                              {
  return as_hash (f.rep); }
nat mmx::hard_hash ( const syntactic &  c) [inline]

Definition at line 53 of file syntactic.hpp.

References hard_hash().

{ return hard_hash (*c); }
triple<C1,C2,C3> mmx::HARD_IDENTITY_OP_SUGAR ( template< typename C1, typename C2, typename C3 >  ,
triple< C1, C2, C3 >   
)
bool mmx::hard_less ( const C &  x,
const C &  y 
) [inline]

Definition at line 163 of file basix.hpp.

References inside().

Referenced by hard_less_op::op().

                                                                    {
  return ((void*) inside (x)) < ((void*) inside (y)); }
bool mmx::hard_neq ( const C &  x,
const C &  y 
) [inline]

Definition at line 161 of file basix.hpp.

References exact_neq().

Referenced by hard_neq(), hard_eq_op::not_op(), and hard_neq_op::op().

                                                                   {
  return exact_neq (x, y); }
bool mmx::hard_neq ( const document c1,
const document c2 
) [inline]

Definition at line 61 of file document.hpp.

References hard_neq().

                                                              {
  return hard_neq (*c1, *c2); }
bool mmx::hard_neq ( const compound c1,
const compound c2 
) [inline]

Definition at line 57 of file compound.hpp.

References as_vector(), and hard_neq().

                                                              {
  return hard_neq (as_vector (c1), as_vector (c2)); }
bool mmx::hard_neq ( const syntactic &  c1,
const syntactic &  c2 
) [inline]

Definition at line 64 of file syntactic.hpp.

References hard_neq().

                                                                {
  return hard_neq (*c1, *c2); }
bool mmx::hard_neq ( const exception &  e1,
const exception &  e2 
) [inline]

Definition at line 49 of file exception.hpp.

References hard_neq().

                                                                {
  return hard_neq (*e1, *e2); }
bool mmx::hard_neq ( const function_0< D > &  f,
const function_0< D > &  g 
) [inline]

Definition at line 99 of file function.hpp.

                                                                 {
  return (f.rep) != (g.rep); }
bool mmx::hard_neq ( const function_1< D, S1 > &  f,
const function_1< D, S1 > &  g 
) [inline]

Definition at line 148 of file function.hpp.

                                                                 {
  return (f.rep) != (g.rep); }
bool mmx::hard_neq ( const list< C > &  x,
const list< C > &  y 
) [inline]

Definition at line 129 of file list.hpp.

                                                         {
  return (x.operator -> ()) != (y.operator -> ()); }
bool mmx::hard_neq ( const function_2< D, S1, S2 > &  f,
const function_2< D, S1, S2 > &  g 
) [inline]

Definition at line 241 of file function.hpp.

                                                                 {
  return (f.rep) != (g.rep); }
bool mmx::hard_neq ( const function_3< D, S1, S2, S3 > &  f,
const function_3< D, S1, S2, S3 > &  g 
) [inline]

Definition at line 293 of file function.hpp.

                                                                 {
  return (f.rep) != (g.rep); }
bool mmx::hard_neq ( const chain< C > &  x,
const chain< C > &  y 
) [inline]

Definition at line 120 of file chain.hpp.

                                                           {
  return (x.operator -> ()) != (y.operator -> ()); }
bool mmx::hard_neq ( const function_4< D, S1, S2, S3, S4 > &  f,
const function_4< D, S1, S2, S3, S4 > &  g 
) [inline]

Definition at line 345 of file function.hpp.

                                                                 {
  return (f.rep) != (g.rep); }
bool mmx::hard_neq ( const function_5< D, S1, S2, S3, S4, S5 > &  f,
const function_5< D, S1, S2, S3, S4, S5 > &  g 
) [inline]

Definition at line 397 of file function.hpp.

                                                                 {
  return (f.rep) != (g.rep); }
bool mmx::hard_neq ( const literal c1,
const literal c2 
) [inline]

Definition at line 54 of file literal.hpp.

References as_string(), and hard_neq().

                                                            {
  return hard_neq (as_string (c1), as_string (c2)); }
bool mmx::hard_neq ( const function_6< D, S1, S2, S3, S4, S5, S6 > &  f,
const function_6< D, S1, S2, S3, S4, S5, S6 > &  g 
) [inline]

Definition at line 449 of file function.hpp.

                                                                 {
  return (f.rep) != (g.rep); }
bool mmx::hard_neq ( const function_7< D, S1, S2, S3, S4, S5, S6, S7 > &  f,
const function_7< D, S1, S2, S3, S4, S5, S6, S7 > &  g 
) [inline]

Definition at line 501 of file function.hpp.

                                                                 {
  return (f.rep) != (g.rep); }
bool mmx::hard_neq ( const function_8< D, S1, S2, S3, S4, S5, S6, S7, S8 > &  f,
const function_8< D, S1, S2, S3, S4, S5, S6, S7, S8 > &  g 
) [inline]

Definition at line 553 of file function.hpp.

                                                                 {
  return (f.rep) != (g.rep); }
mmx::HARD_TO_EXACT_IDENTITY_SUGAR ( dynamic  )
mmx::HARD_TO_EXACT_IDENTITY_SUGAR ( template< typename C >  ,
iterator< C >   
)
mmx::HARD_TO_EXACT_IDENTITY_SUGAR ( template< typename D >  ,
function_0< D >   
)
mmx::HARD_TO_EXACT_IDENTITY_SUGAR ( template< typename D, typename S1 >  ,
function_1< D, S1 >   
)
mmx::HARD_TO_EXACT_IDENTITY_SUGAR ( template< typename D, typename S1, typename S2 >  ,
function_2< D, S1, S2 >   
)
mmx::HARD_TO_EXACT_IDENTITY_SUGAR ( template< typename D, typename S1, typename S2, typename S3 >  ,
function_3< D, S1, S2, S3 >   
)
mmx::HARD_TO_EXACT_IDENTITY_SUGAR ( template< typename D, typename S1, typename S2, typename S3, typename S4 >  ,
function_4< D, S1, S2, S3, S4 >   
)
mmx::HARD_TO_EXACT_IDENTITY_SUGAR ( template< typename D, typename S1, typename S2, typename S3, typename S4, typename S5 >  ,
function_5< D, S1, S2, S3, S4, S5 >   
)
mmx::HARD_TO_EXACT_IDENTITY_SUGAR ( template< typename D, typename S1, typename S2, typename S3, typename S4, typename S5, typename S6 >  ,
function_6< D, S1, S2, S3, S4, S5, S6 >   
)
mmx::HARD_TO_EXACT_IDENTITY_SUGAR ( template< typename D, typename S1, typename S2, typename S3, typename S4, typename S5, typename S6, typename S7 >  ,
function_7< D, S1, S2, S3, S4, S5, S6, S7 >   
)
mmx::HARD_TO_EXACT_IDENTITY_SUGAR ( template< typename D, typename S1, typename S2, typename S3, typename S4, typename S5, typename S6, typename S7, typename S8 >  ,
function_8< D, S1, S2, S3, S4, S5, S6, S7, S8 >   
)
mmx::HARD_TO_TRUE_IDENTITY_SUGAR ( observer  )
mmx::HARD_TO_TRUE_IDENTITY_SUGAR ( dynamic  )
port mmx::HARD_TO_TRUE_IDENTITY_SUGAR ( port  ) const

Definition at line 62 of file port.hpp.

                                         { return p->expression (); }
bool has_trace ( const generic exc)

Definition at line 84 of file exception.cpp.

References GEN_BACKTRACE, GEN_EXCEPTION, and is_func().

Referenced by backtrace(), source_exception(), and trace_depth().

                               {
  if (!is<exception> (exc)) return false;
  generic msg= *as<exception> (exc);
  return
    is_func (msg, GEN_EXCEPTION, 2) &&
    is_func (msg[2], GEN_BACKTRACE, 2);
}
nat mmx::hash ( const string s)

Definition at line 61 of file string.cpp.

References n, and N().

                       {
  register const char* a= S(s);
  register nat i, h=0, n= N(s);
  for (i=0; i<n; i++)
    h= (h<<1) ^ (h<<9) ^ (h>>23) ^ ((nat) a[i]);
  return h;
}
nat hash ( const symbol< C, V > &  s) [inline]

Definition at line 99 of file symbol.hpp.

References hash().

                                       {
  return hash (*s); }
nat mmx::hash ( const generic &  g) [inline]

Definition at line 162 of file generic.hpp.

                                   {
  return g->get_hash_value (); }
nat mmx::hash ( const document c) [inline]

Definition at line 48 of file document.hpp.

References hash().

{ return hash (*c); }
nat mmx::hash ( const compound c) [inline]
nat mmx::hash ( const exception &  e) [inline]

Definition at line 36 of file exception.hpp.

References hash().

{ return hash (*e); }
nat mmx::hash ( const syntactic &  c) [inline]

Definition at line 51 of file syntactic.hpp.

References hash().

{ return hash (*c); }
nat mmx::hash ( const iterator< C > &  it) [inline]
nat mmx::hash ( signed char  c) [inline]

Definition at line 63 of file defaults.hpp.

{ return (nat) c; }
nat mmx::hash ( char  c) [inline]

Definition at line 62 of file defaults.hpp.

{ return (nat) c; }
nat mmx::hash ( unsigned char  c) [inline]

Definition at line 64 of file defaults.hpp.

{ return (nat) c; }
nat mmx::hash ( short int  c) [inline]

Definition at line 65 of file defaults.hpp.

{ return (nat) c; }
nat mmx::hash ( short unsigned int  c) [inline]

Definition at line 66 of file defaults.hpp.

{ return (nat) c; }
nat mmx::hash ( int  c) [inline]

Definition at line 67 of file defaults.hpp.

{ return (nat) c; }
nat mmx::hash ( long int  c) [inline]

Definition at line 69 of file defaults.hpp.

{ return (nat) c; }
nat mmx::hash ( unsigned int  c) [inline]

Definition at line 68 of file defaults.hpp.

{ return (nat) c; }
nat mmx::hash ( long unsigned int  c) [inline]

Definition at line 70 of file defaults.hpp.

{ return (nat) c; }
nat mmx::hash ( const literal c) [inline]

Definition at line 41 of file literal.hpp.

References hash().

{ return hash (as_symbol (c)); }
nat mmx::hash ( long long int  c) [inline]

Definition at line 71 of file defaults.hpp.

                                  {
  nat h = (nat) ((c >> (4 * sizeof (long int))) >> (4 * sizeof (long int)));
  return (h<<1) ^ (h<<5) ^ (h>>27) ^ ((nat) c); }
nat mmx::hash ( long long unsigned int  c) [inline]

Definition at line 74 of file defaults.hpp.

                                           {
  nat h = (nat) ((c >> (4 * sizeof (long int))) >> (4 * sizeof (long int)));
  return (h<<1) ^ (h<<5) ^ (h>>27) ^ ((nat) c); }
nat mmx::hash ( const float &  x) [inline]

Definition at line 77 of file defaults.hpp.

                                 {
  return (*((nat*) ((void*) &x))) & 0xffffffff; }
nat mmx::hash ( const cpp_printer p) [inline]

Definition at line 290 of file cpp_printer.cpp.

                            {
  return 0;
}
nat mmx::hash ( const double &  x) [inline]

Definition at line 79 of file defaults.hpp.

References n.

                                  {
  union { nat n; double d; } u;
  u.d= x; return u.n; }
nat mmx::hash ( C *  p) [inline]

Definition at line 82 of file defaults.hpp.

References as_hash().

{ return as_hash (p); }
nat mmx::hash ( const symbol< C, equal_table > &  s) [inline]

Definition at line 113 of file symbol.hpp.

References exact_hash().

                                                                      {
  return exact_hash (s); }
generic mmx::hlist ( const vector< generic > &  v) [inline]

Definition at line 145 of file mmx_printer.cpp.

References gen().

                                                {
  return gen ("$hlist", v); }
double hypot ( const double &  x,
const double &  y 
) [inline]

Definition at line 57 of file double.hpp.

References hypot().

                                                       {
  return ::hypot (x, y); }
syntactic hypot ( const syntactic g1,
const syntactic g2 
)

Definition at line 419 of file syntactic.cpp.

References GEN_HYPOT, and syn().

                                                           {
  return syn (GEN_HYPOT, g1, g2); }
generic hypot ( const generic x1,
const generic x2 
)

Definition at line 516 of file generic.cpp.

References ACC_BINARY, ACC_HYPOT, sqrt(), and square().

                                           {
  ACC_BINARY (ACC_HYPOT, x, y);
  return sqrt (square (x) + square (y));
}
C mmx::hypot ( const C &  x,
const C &  y 
) [inline]

Definition at line 571 of file defaults.hpp.

References sqrt(), and square().

Referenced by hypot(), hypot_op::op(), and hypot_op::set_op().

                               {
  return sqrt (square (x) + square (y));
}
const C & I ( const table< C, T, V > &  t) [inline]

Definition at line 207 of file table.hpp.

                   {
  t->lazy_initialize ();
  return *t->init;
}
routine identity_routine ( const vector< nat > &  sig)

Definition at line 112 of file routine.cpp.

References ASSERT, and N().

                                          {
  // WARNING: we do allow for "fake identity functions" with sig[0] != sig[1]
  // This is useful for fast conversions to generic
  ASSERT (N(sig) == 2, "identity routine should take one argument");
  return new identity_routine_rep (sig);
}
syntactic Im ( const syntactic g1)

Definition at line 425 of file syntactic.cpp.

References GEN_IM, and syn().

{ return syn (GEN_IM, g1); }
generic Im ( const generic x1)

Definition at line 735 of file generic.cpp.

References current_ev, and GEN_IM.

                               {
  return current_ev->apply (GEN_IM, x1); }
C mmx::Im ( const C &  x) [inline]

Definition at line 713 of file defaults.hpp.

Referenced by Im_op::op(), Im_op::Real_type(), and Im_op::set_op().

{ return 0; }
vector<Real_type(C),V> mmx::Im ( const vector< C, V > &  v)

Definition at line 1155 of file vector.hpp.

{ return unary_map<Im_op> (v); }
C mmx::imaginary_cst ( ) [inline]

Definition at line 743 of file type_props.hpp.

References C, and set_imaginary().

{ C r; set_imaginary (r); return r; }
alias<C> mmx::incarnate_genalias ( const generic_alias< C > &  a) [inline]

Definition at line 166 of file alias.hpp.

                                                                    {
  return new incarnate_alias_rep<C> (a); }
double incexp2 ( const double &  x,
const S &  y 
) [inline]

Definition at line 99 of file double.hpp.

{ return ldexp (x, y); }
void incexp2 ( double &  x,
const double &  y,
const S &  z 
) [inline]

Definition at line 105 of file double.hpp.

{ x= ldexp (y, z); }
double incexp2 ( const double &  x) [inline]

Definition at line 101 of file double.hpp.

{ return ldexp (x, 1); }
generic incexp2 ( const generic x1,
const xint x2 
)

Definition at line 788 of file generic.cpp.

References current_ev.

                                                    {
  return current_ev->apply ("increase_exponent", x1, as<generic> ((int) x2)); }
C mmx::incexp2 ( const C &  x,
const S &  y 
) [inline]

Definition at line 393 of file defaults.hpp.

Referenced by GLUE_43(), incexp2_op::op(), and incexp2_op::set_op().

{ return x << y; }
C mmx::incexp2 ( const C &  x) [inline]

Definition at line 395 of file defaults.hpp.

{ return incexp2<C,xint> (x, 1); }
void mmx::incexp2 ( C &  x,
const C &  y,
const S &  z 
) [inline]

Definition at line 399 of file defaults.hpp.

{ x= y << z; }
void incexp2_assign ( double &  x,
const S &  y 
) [inline]

Definition at line 103 of file double.hpp.

{ x= ldexp (x, y); }
void mmx::incexp2_assign ( C &  x,
const S &  y 
) [inline]

Definition at line 397 of file defaults.hpp.

Referenced by incexp2_op::set_op().

{ x <<= y; }
void include ( const string name)

Definition at line 114 of file dlink.cpp.

References eval(), and gen().

                             {
  generic r= eval (gen ("include", as<generic> (name)));
  if (is<exception> (r)) throw as<exception> (r);
}
generic mmx::indented ( const vector< generic > &  v) [inline]

Definition at line 149 of file mmx_printer.cpp.

References gen().

                                                   {
  return gen ("$indent", v); }
mmx::INDIRECT_IMPL ( evaluator  ,
evaluator_rep   
)
mmx::INDIRECT_IMPL ( generic  ,
generic_rep   
)

Definition at line 146 of file generic.hpp.

                                      {
  return generic (this, true); }
mmx::INDIRECT_IMPL ( string  ,
string_rep   
)
mmx::INDIRECT_IMPL ( updater  ,
updater_rep   
)

Definition at line 133 of file dynamic.cpp.

References arg(), ARGUMENT_OBSERVER, and destroy().

                           : public observer_rep {
public:
  updater u;

  inline argument_observer_rep (dynamic_rep* arg, const updater& u2):
    observer_rep (arg), u (u2) {}
  inline ~argument_observer_rep () {}
  inline nat observer_type () const { return ARGUMENT_OBSERVER; }
  inline void destroy () const { mmx::destroy (u); }
  inline void modify () const { u->update (); }
};
mmx::INDIRECT_IMPL ( port  ,
port_rep   
)
mmx::INDIRECT_IMPL_1 ( heap  ,
heap_rep  ,
typename C  ,
 
)

Definition at line 96 of file heap.hpp.

References C, min(), and n.

                        {
  if (n2 > l || n2 < ((l+1)>>1)) {
    nat l2= (((n2 < ((l+1)>>1)) || (n2 > (l<<1))) ? n2: l<<1);
    C* b= mmx_new<C> (l2);
    nat nn= min (n, n2);
    for (nat i=0; i<nn; i++) b[i]= a[i];
    mmx_delete<C> (a, l);
    a= b;
    l= l2;
  }
  n= n2;
}
mmx::INDIRECT_IMPL_1 ( iterator  ,
iterator_rep  ,
typename C  ,
 
) const

Definition at line 95 of file iterator.hpp.

                                           { return it.rep->is_busy (); }
mmx::INDIRECT_IMPL_1 ( alias  ,
alias_rep  ,
typename C  ,
 
) const

Definition at line 52 of file alias.hpp.

References flatten().

                                               { return flatten (a->get ()); }
mmx::INDIRECT_IMPL_2 ( symbol  ,
symbol_rep  ,
typename C  ,
,
typename V  ,
 
)

Definition at line 88 of file symbol.hpp.

References SYMBOLIC_LITERAL.

                                                             {
  static const nat id= SYMBOLIC_LITERAL; };
mmx::INDIRECT_IMPL_2 ( vector  ,
vector_rep  ,
typename C  ,
,
typename V  ,
 
)
mmx::INDIRECT_IMPL_3 ( table  ,
table_rep  ,
typename C  ,
,
typename T  ,
,
typename V  ,
 
)
mmx::INDIRECT_IMPL_3 ( sparse_vector  ,
sparse_vector_rep  ,
typename C  ,
,
typename T  ,
,
typename V  ,
 
)
mmx::INDIRECT_NULL_IMPL ( observer  ,
observer_rep   
)
mmx::INDIRECT_NULL_IMPL ( dynamic  ,
dynamic_rep   
) const
mmx::INDIRECT_NULL_IMPL ( task  ,
task_rep   
)
mmx::INDIRECT_NULL_IMPL ( routine  ,
routine_rep   
) const

Definition at line 96 of file routine.hpp.

                                        {
  return fun.rep == NULL; }
mmx::INDIRECT_NULL_IMPL ( primitive  ,
primitive_rep   
) const

Definition at line 43 of file primitive.hpp.

                                          {
  return fun.rep == NULL; }
table<C,T,V> mmx::inf ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 631 of file table.hpp.

                                                       {
  return binary_map<inf_op,C,T,V> (t, u); }
vector<C,V> mmx::inf ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1051 of file vector.hpp.

                                                   {
  return binary_map<inf_op> (v, w); }
C mmx::inf ( const C &  x,
const C &  y 
)

Definition at line 512 of file defaults.hpp.

References min().

Referenced by inf_op::op(), and inf_op::set_op().

{ return min (x, y); }
sparse_vector<C,T,V> mmx::inf ( const sparse_vector< C, T, V > &  t,
const sparse_vector< C, T, V > &  u 
) [inline]

Definition at line 270 of file sparse_vector.hpp.

                                                     {
  return binary_map<inf_op,C,T,V> (t, u); }
C mmx::infinity_cst ( ) [inline]

Definition at line 755 of file type_props.hpp.

References C, and set_infinity().

{ C r; set_infinity (r); return r; }
generic mmx::infix ( const generic g,
const generic op,
const generic h 
) [inline]

Definition at line 129 of file mmx_printer.cpp.

References gen().

Referenced by mmx_printer::pp_E0().

                                                                             {
  return gen ("$infix", g, op, h); }
static void mmx::init ( table< generic, generic > &  t,
const generic key,
const generic val 
) [inline, static]

Definition at line 153 of file mmx_printer.cpp.

References val.

                                                                         {
  t[key]= val;
}
void init_system ( )

Definition at line 67 of file system.cpp.

References file_exists(), user_dir(), and var_mkdir().

Referenced by eval_system(), path_name(), system_instance::system_instance(), and var_load().

               {
  string path = user_dir ();
  if (!file_exists (path)) {
    printf ("This is your first use of Mathemagix.\n");
    printf ("I am creating a .mathemagix directory in your home directory\n");
    var_mkdir (path);
  }
  var_mkdir (path * "/etc");
  var_mkdir (path * "/lib");
  var_mkdir (path * "/var");
  var_mkdir (path * "/mmx");
  var_mkdir (path * "/tmp");
}
void mmx::init_threads ( )

Definition at line 222 of file threads.cpp.

{}
syntactic inject ( const syntactic x,
const syntactic y,
const syntactic z 
)

Definition at line 485 of file syntactic.cpp.

References syn().

Referenced by mv_inject_op::op(), and mv_inject_op::set_op().

                                                                              {
  return syn ("inject", x, y, z); }
port input_file_port ( const string name)

Definition at line 106 of file file_port.cpp.

References as_charp(), decode_name(), error_port(), and free_charp().

Referenced by var_load().

                                     {
  string name_s= decode_name (name);
  char* temp= as_charp (name_s);
  FILE* f= fopen (temp, "r");
  free_charp (temp);
  if (f == NULL) return error_port ("file '" * name * "' not found");
  return input_file_port (f, true, name);
}
port mmx::input_file_port ( FILE *  f,
bool  close_flag,
const string name 
)

Definition at line 75 of file file_port.cpp.

                                                               {
  return (port_rep*) new file_port_rep (2, f, close_flag, name);
}
port input_output_file_port ( const string name)

Definition at line 116 of file file_port.cpp.

References as_charp(), decode_name(), error_port(), and free_charp().

                                            {
  string name_s= decode_name (name);
  char* temp= as_charp (name_s);
  FILE* f= fopen (temp, "w+");
  free_charp (temp);
  if (f == NULL) return error_port ("file '" * name * "' did not open");
  return input_output_file_port (f, true, name);
}
port mmx::input_output_file_port ( FILE *  f,
bool  close_flag,
const string name 
)

Definition at line 80 of file file_port.cpp.

                                                                      {
  return (port_rep*) new file_port_rep (3, f, close_flag, name);
}
port input_output_string_port ( string &  s)

Definition at line 105 of file string_port.cpp.

                                     {
  return (port_rep*) new input_output_string_port_rep (s);
}
port input_string_port ( const string &  s)

Definition at line 68 of file string_port.cpp.

Referenced by GLUE_1().

                                    {
  return (port_rep*) new input_string_port_rep (s);
}
vector<C,V> mmx::insert ( const vector< C, V > &  v,
const C &  x 
)

Definition at line 702 of file vector.hpp.

References append(), and contains().

                                     {
  if (contains (v, x)) return v;
  else return append (v, x);
}
vector<C,V> mmx::insert ( const vector< C, V > &  v,
const C &  x,
nat  pos 
)

Definition at line 708 of file vector.hpp.

References ASSERT, C, CF(), n, N(), pos, seg(), and Vector.

                                              {
  // insert x at 'pos' in v
  ASSERT (pos <= N(v), "position out of range");
  nat n= N(v) + 1, i; nat l= aligned_size<C,V> (n);
  C* a= mmx_formatted_new<C> (l, CF(v));
  const C* p= seg (v);
  for (i= 0; i < pos; i++, p++) a[i]= *p;
  a[pos]= x; i++;
  for (;i < n; i++, p++) a[i]= *p;
  return Vector (a, n, l, CF(v));
}
vector<C,V> mmx::insert ( const vector< C, V > &  v,
const vector< C, V > &  x,
const vector< nat, W > &  pos 
)

Definition at line 721 of file vector.hpp.

References ASSERT, C, CF(), n, N(), seg(), and Vector.

                                                                    {
  // insert x[0] at pos[0] in v, then x[1] at pos[1], etc
  ASSERT (N(x) == N(pos), "wrong sizes");
  nat n= N(v) + N(x), i= 0; nat l= aligned_size<C,V> (n);  
  C* a= mmx_formatted_new<C> (l, CF(v));
  const C* p= seg (v);
  for (nat k= 0; k < N(pos); k++) {
    ASSERT (pos[k] < n, "position out of range");
    for (; i < pos[k]; i++, p++) a[i]= *p;
    a[pos[k]]= x[k]; i++;
  }
  for (;i < n; i++, p++) a[i]= *p;
  return Vector (a, n, l, CF(v));
}
list<C> mmx::insert ( const list< C > &  l,
const C &  x 
)

Definition at line 313 of file list.hpp.

References car(), cdr(), cons(), is_nil(), and List.

Referenced by GLUE_15(), GLUE_16(), and GLUE_17().

                                   {
  if (is_nil (l)) return List (x);
  else if (car (l) == x) return l;
  else return cons (car (l), insert<C> (cdr (l), x));
}
char* mmx::inside ( const string &  s,
nat  pos 
) [inline]

Definition at line 110 of file string.hpp.

References pos.

                                               {
  return s.rep->a + pos; }
list_rep<C>* mmx::inside ( const list< C > &  x)

Definition at line 123 of file list.hpp.

References List_rep.

                                      {
  return const_cast<List_rep*> (x.operator -> ()); }
void mmx::inside_append ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 668 of file vector.hpp.

References ASSERT, copy(), inside(), is_non_scalar(), N(), n, and seg().

                                                 {
  typedef implementation<vector_linear,V> Vec;
  ASSERT (is_non_scalar (v) && is_non_scalar (w),
          "non-scalar vectors expected");
  nat n= N(v), p= N(w);
  inside (v)->resize (n + p);
  Vec::copy (const_cast<C*> (seg (v)) + n, seg (w), p);
}
void mmx::inside_set ( const table< C, T, V > &  t,
const K &  x,
const C &  v 
) [inline]

Definition at line 168 of file table.hpp.

References inside().

Referenced by GLUE_14(), GLUE_9(), new_type_id(), and register_glue().

                                                                      {
  inside (t) -> set (as<T> (x)) = v; }
void mmx::inside_set ( const table< C, T, V > &  t,
const T &  x,
const C &  v 
) [inline]

Definition at line 179 of file table.hpp.

References inside().

                                                                     {
  inside (t) -> set (x) = v; }
syntactic integrate ( const syntactic g)

Definition at line 458 of file syntactic.cpp.

References GEN_INTEGRATE, and syn().

                                         {
  return syn (GEN_INTEGRATE, g); }
syntactic integrate ( const syntactic g,
const syntactic v 
)

Definition at line 460 of file syntactic.cpp.

References GEN_INTEGRATE, and syn().

                                                             {
  return syn (GEN_INTEGRATE, g, v); }
routine integrate ( const routine fun)

Definition at line 248 of file routine.cpp.

                             {
  return new integrate_routine_rep (r);
}
generic integrate ( const generic x1,
const generic x2 
)

Definition at line 688 of file generic.cpp.

References ACC_BINARY_SCALAR, ACC_DERIVE_WRT, current_ev, and GEN_INTEGRATE.

                                                {
  ACC_BINARY_SCALAR (ACC_DERIVE_WRT, x1, v);
  return current_ev->apply (GEN_INTEGRATE, x1, v);
}
vector<C,V> mmx::integrate ( const vector< C, V > &  v)

Definition at line 1101 of file vector.hpp.

                                        {
  return unary_map<integrate_op> (v); }
vector<C,V> mmx::integrate ( const vector< C, V > &  v,
const X &  x 
)

Definition at line 1107 of file vector.hpp.

                                        {
  return binary_map_scalar<integrate_op> (v, x); }
syntactic integrate_init ( const syntactic x,
const syntactic c 
)

Definition at line 473 of file syntactic.cpp.

References syn().

                                                                  {
  return syn ("integrate_init", g, c); }
generic integrate_init ( const generic x,
const generic c 
)

Definition at line 811 of file generic.cpp.

References current_ev.

Referenced by integrate_op::op_init().

                                                              {
  return current_ev->apply ("integrate_init", x1, x2); }
syntactic integrate_init ( const syntactic g,
const syntactic v,
const syntactic c 
)

Definition at line 475 of file syntactic.cpp.

References syn().

                                              {
  return syn ("integrate_init", g, v, c); }
mmx::INV_TRIGO_SUGAR ( double  )
double invert ( const double &  x) [inline]

Definition at line 123 of file double.hpp.

{ return 1.0 / x; }
syntactic invert ( const syntactic g)

Definition at line 284 of file syntactic.cpp.

                            {
  return syntactic (1) / g;
}
generic invert ( const generic x1)

Definition at line 375 of file generic.cpp.

References ACC_INVERT, ACC_UNARY, current_ev, and GEN_OVER.

                           {
  ACC_UNARY (ACC_INVERT, x1);
  return current_ev->apply (GEN_OVER, 1, x1);
}
C mmx::invert ( const C &  x) [inline]

Definition at line 557 of file defaults.hpp.

References promote().

Referenced by invert_op::op(), and invert_op::set_op().

                    {
  return promote (1, x) / x;
}
bool mmx::is ( const generic &  x) [inline]

Definition at line 182 of file generic.hpp.

References type().

Referenced by binary_helper< vector< C, V > >::assemble(), default_routine(), and vector_size().

                                       {
  return type (x) == type_information<C>::id; }
bool mmx::is_a_scalar ( const vector< C, vector_fixed< V, S > > &  v) [inline]

Definition at line 354 of file vector.hpp.

{ (void) v; return false; }
bool mmx::is_alias_type ( nat  id) [inline]

Definition at line 182 of file alias.hpp.

References alias_type_info().

Referenced by define_type_sub(), and generic_object_rep::expression().

                       {
  int mode= 0;
  alias_type_info (id, mode);
  return mode == 1;
}
bool mmx::is_alpha ( const generic g)

Definition at line 210 of file mmx_texmacs.cpp.

References literal_to_string(), N(), and s.

Referenced by as_texmacs(), mmx_lex(), and test_keyword().

                            {
  if (!is<literal> (g)) return false;
  string s= literal_to_string (g);
  for (nat i=0; i<N(s); i++)
    if ((s[i] < 'a' || s[i] > 'z') &&
        (s[i] < 'A' || s[i] > 'Z'))
      return false;
  return true;
}
static bool is_applicable ( const generic g) [static]

Definition at line 1080 of file cpp_printer.cpp.

References CPP_AND, CPP_IF, CPP_OR, CPP_SPECIALIZE, CPP_TYPE_CONSTRUCTOR, CPP_UNALIAS, CPP_UNPOINTER, CPP_XOR, is_func(), and N().

                                 {
  if (is<literal> (g)) {
    string s= *as<literal> (g);
    if (N(s) == 0) return false;
    nat i;
    for (i=0; i<N(s); i++)
      if (((s[i]<'0') || (s[i]>'9')) &&
          ((s[i]<'a') || (s[i]>'z')) &&
          ((s[i]<'A') || (s[i]>'Z')) &&
          ((s[i]<'_') || (s[i]>'_')))
        return false;
    return
      s != CPP_IF && s != CPP_AND && s != CPP_OR && s != CPP_XOR &&
      s != CPP_UNALIAS && s != CPP_UNPOINTER;
  }
  else if (is_func (g, CPP_SPECIALIZE) && N(g)>=2 && is_applicable (g[1]))
    return true;
  else if (is_func (g, CPP_TYPE_CONSTRUCTOR, 1))
    return true;
  else return false;
}
bool is_atom ( const syntactic g)

Definition at line 25 of file syntactic.cpp.

{ return is<literal> (*g); }
bool mmx::is_atom ( const vector< C, V > &  v) [inline]

Definition at line 218 of file vector.hpp.

References is_non_scalar(), and N().

                                           {
  return is_non_scalar (v) && N(v) == 1; }
bool mmx::is_atom ( const list< C > &  l) [inline]

Return true iff l has length 1.

Definition at line 152 of file list.hpp.

References cdr(), and is_nil().

Referenced by GLUE_14(), GLUE_15(), GLUE_16(), and signed_decompose().

                                         {
  return !is_nil (l) && is_nil (cdr (l)); }
static bool mmx::is_C0 ( const generic g) [static]

Definition at line 308 of file mmx_printer.cpp.

References GEN_ASSIGN, GEN_ASSIGN_MACRO, GEN_ASSUME, GEN_BEGIN, GEN_BREAK, GEN_CATEGORY, GEN_CLASS, GEN_CONSTANT, GEN_CONTINUE, GEN_DEFINE, GEN_DEFINE_MACRO, GEN_EXISTS, GEN_EXTERN, GEN_FORALL, GEN_FOREIGN, GEN_GTRGTREQ, GEN_IF, GEN_INTERN, GEN_LAMBDA, GEN_LESSLESSEQ, GEN_LOOP, GEN_MACRO, GEN_METHOD, GEN_MINUS_ASSIGN, GEN_MODULE, GEN_MUTABLE, GEN_OVER_ASSIGN, GEN_PENALTY, GEN_PLUS_ASSIGN, GEN_PRIVATE, GEN_PUBLIC, GEN_RETURN, GEN_TIMES_ASSIGN, GEN_TRY, is_func(), and N().

Referenced by print_mmx().

                         {
  if (is_func (g, GEN_BEGIN) ||
      is_func (g, GEN_IF) ||
      is_func (g, GEN_LOOP) ||
      is_func (g, GEN_BREAK) ||
      is_func (g, GEN_CONTINUE) ||
      is_func (g, GEN_TRY) ||
      is_func (g, GEN_LAMBDA) ||
      is_func (g, GEN_MACRO) ||
      is_func (g, GEN_RETURN) ||
      is_func (g, GEN_CLASS) ||
      is_func (g, GEN_MODULE) ||
      is_func (g, GEN_CATEGORY))
    return true;
  if (N(g) == 2 && is_C0 (g[1]))
    return
      is_func (g, GEN_INTERN) ||
      is_func (g, GEN_METHOD) ||
      is_func (g, GEN_EXTERN) ||
      is_func (g, GEN_MUTABLE) ||
      is_func (g, GEN_CONSTANT) ||
      is_func (g, GEN_PUBLIC) ||
      is_func (g, GEN_PRIVATE);
  if (N(g) == 3 && is_C0 (g[2]))
    return
      is_func (g, GEN_FORALL) ||
      is_func (g, GEN_EXISTS) ||
      is_func (g, GEN_ASSUME) ||
      is_func (g, GEN_PENALTY) ||
      is_func (g, GEN_DEFINE) ||
      is_func (g, GEN_ASSIGN) ||
      is_func (g, GEN_DEFINE_MACRO) ||
      is_func (g, GEN_ASSIGN_MACRO) ||
      is_func (g, GEN_PLUS_ASSIGN) ||
      is_func (g, GEN_MINUS_ASSIGN) ||
      is_func (g, GEN_TIMES_ASSIGN) ||
      is_func (g, GEN_OVER_ASSIGN) ||
      is_func (g, GEN_LESSLESSEQ) ||
      is_func (g, GEN_GTRGTREQ);
  if (N(g) == 4 && is_C0 (g[3]))
    return
      is_func (g, GEN_FOREIGN);
  return false;
}
bool mmx::is_exact_zero ( const C &  x) [inline]

Definition at line 212 of file defaults.hpp.

References exact_eq(), and promote().

Referenced by _mul_add().

                                                            {
  return exact_eq (x, promote (0, x)); }
bool mmx::is_exact_zero ( const generic &  g1) [inline]

Definition at line 348 of file generic.hpp.

References exact_eq().

{ return exact_eq (g1, 0); }
bool mmx::is_finite ( const table< C, T, V > &  t) [inline]

Definition at line 703 of file table.hpp.

                                            {
  return big<and_is_finite_op> (t); }
bool mmx::is_finite ( const C &  x) [inline]

Definition at line 691 of file defaults.hpp.

Referenced by GLUE_34(), is_finite(), is_finite_op::not_op(), and_is_finite_op::op(), is_finite_op::op(), and and_is_finite_op::set_op().

                                                        {
  (void) x; return true; }
bool mmx::is_finite ( const vector< C, V > &  v) [inline]

Definition at line 1123 of file vector.hpp.

References is_a_scalar(), and is_finite().

                                             {
  if (is_a_scalar (v)) return is_finite (v.scalar());
  return big<and_is_finite_op> (v); }
bool is_func ( const syntactic g,
const syntactic f,
nat  n 
)

Definition at line 78 of file syntactic.cpp.

References is_func().

                                                             {
  return is_func (*g, *f, n); }
bool is_func ( const syntactic g,
const char *  f,
nat  n 
)

Definition at line 74 of file syntactic.cpp.

References is_func().

                                                        {
  return is_func (*g, f, n); }
bool is_func ( const syntactic g,
const char *  f 
)

Definition at line 72 of file syntactic.cpp.

References is_func().

                                                 {
  return is_func (*g, f); }
bool is_func ( const syntactic g,
const syntactic f 
)

Definition at line 76 of file syntactic.cpp.

References is_func().

                                                      {
  return is_func (*g, *f); }
bool is_func ( const syntactic g,
const generic f,
nat  n 
)

Definition at line 82 of file syntactic.cpp.

References is_func().

                                                           {
  return is_func (*g, f, n); }
bool is_func ( const syntactic g,
const generic f 
)

Definition at line 80 of file syntactic.cpp.

References is_func().

                                                    {
  return is_func (*g, f); }
bool is_func ( const generic g,
const generic f,
nat  n 
)

Definition at line 75 of file generic_utils.cpp.

References exact_eq(), and N().

                                                    {
  return is<compound> (g) && N (g) == (n+1) && exact_eq (g[0], f);
}
bool is_func ( const generic g,
const char *  f,
nat  n 
)

Definition at line 65 of file generic_utils.cpp.

References exact_eq(), and N().

                                                 {
  return is<compound> (g) && N (g) == (n+1) && exact_eq (g[0], generic (f));
}
bool is_func ( const generic g,
const generic f 
)

Definition at line 70 of file generic_utils.cpp.

References exact_eq().

                                             {
  return is<compound> (g) && exact_eq (g[0], f);
}
static bool mmx::is_function_type ( const generic g) [static]

Definition at line 563 of file cpp_printer.cpp.

References CPP_FUNCTION_TYPE, CPP_INLINE, CPP_STATIC, and is_func().

                                    {
  return
    is_func (g, CPP_FUNCTION_TYPE) ||
    (is_func (g, CPP_INLINE, 1) && is_function_type (g[1])) ||
    (is_func (g, CPP_STATIC, 1) && is_function_type (g[1]));
}
bool mmx::is_fuzz ( const C &  x) [inline]

Definition at line 695 of file defaults.hpp.

Referenced by is_fuzz(), is_fuzz_op::not_op(), or_is_fuzz_op::op(), is_fuzz_op::op(), and or_is_fuzz_op::set_op().

                                                      {
  (void) x; return false; }
bool mmx::is_fuzz ( const double &  x) [inline]

Definition at line 78 of file double.hpp.

{ (void) x; return false; }
bool mmx::is_fuzz ( const table< C, T, V > &  t) [inline]

Definition at line 709 of file table.hpp.

References is_nan().

                                          {
  return !is_nan (t) && big<or_is_fuzz_op> (t); }
bool mmx::is_fuzz ( const vector< C, V > &  v) [inline]

Definition at line 1132 of file vector.hpp.

References is_a_scalar(), is_fuzz(), and is_nan().

                                           {
  if (is_a_scalar (v)) return is_fuzz (v.scalar());
  return !is_nan (v) && big<or_is_fuzz_op> (v); }
bool mmx::is_infinite ( const vector< C, V > &  v) [inline]

Definition at line 1129 of file vector.hpp.

References is_a_scalar(), is_infinite(), and is_nan().

                                               {
  if (is_a_scalar (v)) return is_infinite (v.scalar());
  return !is_nan (v) && big<or_is_infinite_op> (v); }
bool mmx::is_infinite ( const double &  x) [inline]

Definition at line 77 of file double.hpp.

{ return std::isinf (x); }
bool mmx::is_infinite ( const table< C, T, V > &  t) [inline]

Definition at line 707 of file table.hpp.

References is_nan().

                                              {
  return !is_nan (t) && big<or_is_infinite_op> (t); }
bool mmx::is_infinite ( const C &  x) [inline]

Definition at line 693 of file defaults.hpp.

Referenced by GLUE_35(), is_infinite(), is_infinite_op::not_op(), or_is_infinite_op::op(), is_infinite_op::op(), and or_is_infinite_op::set_op().

                                                          {
  (void) x; return false; }
bool mmx::is_infix ( const generic g,
const generic op 
)

Definition at line 199 of file mmx_texmacs.cpp.

References is_func().

                                               {
  return is_func (g, "$infix", 3) && g[2] == op;
}
bool mmx::is_input_port ( const port &  p) [inline]

Definition at line 92 of file port.hpp.

References inside().

Referenced by composite_port_rep::can_read(), GLUE_10(), composite_port_rep::is_input_port(), composite_port_rep::read(), and composite_port_rep::wait().

                                          {
  return inside (p)->is_input_port (); }
bool mmx::is_list ( const generic &  x) [inline]

Definition at line 221 of file generic.hpp.

References SPECIES_LIST, and species_type().

                                       {
  return species_type (x) == SPECIES_LIST; }
static bool mmx::is_locase ( register char  c) [static]

Definition at line 395 of file string.cpp.

Referenced by upcase(), and upcase_first().

                            {
  int code= (int) ((unsigned char) c);
  return
    ((c>='a') && (c<='z')) ||
    ((code >= 160) && (code < 189)) ||
    (code >= 224);
}
bool mmx::is_nan ( const table< C, T, V > &  t) [inline]

Definition at line 705 of file table.hpp.

                                         {
  return big<or_is_nan_op> (t); }
bool mmx::is_nan ( const double &  x) [inline]

Definition at line 79 of file double.hpp.

{ return std::isnan (x); }
bool mmx::is_nan ( const vector< C, V > &  v) [inline]

Definition at line 1126 of file vector.hpp.

References is_a_scalar(), and is_nan().

                                          {
  if (is_a_scalar (v)) return is_nan (v.scalar());
  return big<or_is_nan_op> (v); }
bool mmx::is_nan ( const C &  x) [inline]

Definition at line 697 of file defaults.hpp.

Referenced by GLUE_36(), is_fuzz(), is_infinite(), is_nan(), is_nan_op::not_op(), or_is_nan_op::op(), is_nan_op::op(), and or_is_nan_op::set_op().

                                                     {
  (void) x; return false; }
bool mmx::is_nil ( const vector< C, V > &  v) [inline]

Definition at line 216 of file vector.hpp.

References N().

                                          {
  return N(v) == 0; }
bool mmx::is_nil ( const source_location &  l) [inline]

Definition at line 92 of file source_track.hpp.

References source_location::end, source_position::line, and source_position::position.

                                  {
  return (l.end.line == 0 && l.end.position == 0);
};
bool is_nil ( const list< C > &  l) [inline]

Return true iff is empty.

Definition at line 150 of file list.hpp.

{ return l.rep == NULL; }
bool is_non_scalar ( const vector< C, V > &  v) [inline]
bool mmx::is_non_scalar ( const vector< C, vector_fixed< V, S > > &  v) [inline]

Definition at line 356 of file vector.hpp.

{ (void) v; return true; }
bool is_numeric ( const string s)

Definition at line 105 of file generic_utils.cpp.

References N().

Referenced by compare_sub(), product_less_op::op(), and sum_less_op::op().

                             {
  return
    (N(s) > 0 && s[0] >= '0' && s[0] <= '9') ||
    (N(s) > 1 && s[0] == '-' && s[1] >= '0' && s[1] <= '9');
}
bool mmx::is_output_port ( const port &  p) [inline]

Definition at line 94 of file port.hpp.

References inside().

Referenced by composite_port_rep::can_write(), composite_port_rep::flush(), GLUE_9(), composite_port_rep::is_output_port(), and composite_port_rep::write().

                                           {
  return inside (p)->is_output_port (); }
bool mmx::is_power_of_two ( nat  p) [inline]

Definition at line 56 of file int.hpp.

                        {
  if (p == 0) return false;
  while ((p & 1) == 0) p >>= 1;
  return p == 1;
}
bool mmx::is_reliable ( const C &  x) [inline]

Definition at line 699 of file defaults.hpp.

Referenced by is_reliable(), is_reliable_op::not_op(), and is_reliable_op::op().

                                                          {
  (void) x; return true; }
bool mmx::is_reliable ( const double &  x) [inline]

Definition at line 80 of file double.hpp.

{ (void) x; return false; }
bool mmx::is_reliable ( const table< C, T, V > &  t) [inline]

Definition at line 711 of file table.hpp.

References C, and is_reliable().

                                              {
  return is_reliable (C (0)); }
bool mmx::is_reliable ( const vector< C, V > &  v) [inline]

Definition at line 1135 of file vector.hpp.

References is_a_scalar(), and is_reliable().

                                               {
  if (is_a_scalar (v)) return is_reliable (v.scalar());
  return is_reliable (C (0)); }
bool mmx::is_table ( const generic &  x) [inline]

Definition at line 223 of file generic.hpp.

References SPECIES_TABLE, and species_type().

                                        {
  return species_type (x) == SPECIES_TABLE; }
bool mmx::is_tuple_type ( nat  id) [inline]

Definition at line 98 of file tuple.hpp.

References tuple_type_info().

Referenced by define_type_sub().

                       {
  bool mode= false;
  tuple_type_info (id, mode);
  return mode;
}
static bool mmx::is_upcase ( register char  c) [static]

Definition at line 404 of file string.cpp.

Referenced by locase(), and locase_first().

                            {
  int code= (int) ((unsigned char) c);
  return
    ((c>='A') && (c<='Z')) ||
    ((code >= 128) && (code < 159)) ||
    ((code >= 192) && (code < 224));
}
bool mmx::is_vector ( const generic &  x) [inline]

Definition at line 219 of file generic.hpp.

References species_type(), and SPECIES_VECTOR.

                                         {
  return species_type (x) == SPECIES_VECTOR; }
iterator<pair<T,C> > mmx::iterate ( const table< C, T, V > &  t)

Definition at line 405 of file table.hpp.

iterator<C> mmx::iterate ( const tuple< C > &  t)

Definition at line 83 of file tuple.hpp.

References as_vector(), and iterate().

                         {
  return iterate (as_vector (t));
}
iterator<C> mmx::iterate ( const heap< C > &  h)

Definition at line 217 of file heap.hpp.

                        {
  return iterator<C> (new heap_iterator_rep<C> (h));
}
iterator<C> mmx::iterate ( const vector< C, V > &  v)

Definition at line 499 of file vector.hpp.

                          {
  return iterator<C> (new vector_iterator_rep<C,V> (v));
}
iterator<C> mmx::iterate ( const list< C > &  l)

Definition at line 201 of file list.hpp.

                        {
  return iterator<C> (new list_iterator_rep<C> (l));
}
iterator<C> mmx::iterate ( const chain< C > &  c)
Examples:
chain_test.cpp, heap_test.cpp, list_test.cpp, table_test.cpp, and vector_test.cpp.

Definition at line 142 of file chain.hpp.

References get_format(), is_nil(), left(), middle(), and right().

Referenced by binary_helper< table< C, T, V > >::disassemble(), flatten(), GLUE_3(), GLUE_4(), lazy_iterator_rep< C, T >::initialize(), iterate(), and unary_hash().

                         {
  if (is_nil (c)) return iterator<C> ();
  return
    lazy_iterator<C,Chain > (left (c), get_format (middle (c))) *
    iterator<C> (middle (c)) *
    lazy_iterator<C,Chain > (right (c), get_format (middle (c)));
}
generic mmx::keyword ( const generic op,
const generic g 
) [inline]

Definition at line 143 of file mmx_printer.cpp.

References gen().

                                                             {
  return gen ("$keyword", op, g); }
generic mmx::keyword ( const generic g) [inline]

Definition at line 141 of file mmx_printer.cpp.

References gen().

Referenced by mmx_lex(), and mmx_printer::pp_E0().

                                          {
  return gen ("$keyword", g); }
C mmx::largest_cst ( ) [inline]

Definition at line 751 of file type_props.hpp.

References C, and set_largest().

{ C r; set_largest (r); return r; }
iterator<C> mmx::lazy_iterator ( const T &  x,
const format< C > &  fm 
)

Definition at line 418 of file iterator.hpp.

References Iterator.

                                             {
  return Iterator (new lazy_iterator_rep<C,T> (x, fm));
}
syntactic lcm ( const syntactic g1,
const syntactic g2 
)

Definition at line 382 of file syntactic.cpp.

References exact_eq(), GEN_LCM, and syn().

                                                         {
  if (exact_eq (g1, 0) || exact_eq (g2, 0)) return 0;
  return syn (GEN_LCM, g1, g2);
}
generic lcm ( const generic x1,
const generic x2 
)

Definition at line 718 of file generic.cpp.

References current_ev, and GEN_LCM.

Referenced by lcm_op::op(), and lcm_op::set_op().

                                                   {
  return current_ev->apply (GEN_LCM, x1, x2); }
bool mmx::less_operator ( const T &  x,
const T &  y 
)

Definition at line 36 of file operators.hpp.

{ return x<y; }
bool mmx::lesseq_operator ( const T &  x,
const T &  y 
)

Definition at line 37 of file operators.hpp.

{ return x<=y; }
generic mmx::list_append_several ( const tuple< list< generic > > &  t)

Definition at line 96 of file glue_list_map.cpp.

References N(), and rebuild().

Referenced by glue_list_map().

                                                     {
  list<generic> r;
  for (int i=N(t)-1; i>=0; i--)
    r= t[i] * r;
  return rebuild (r);
}
generic mmx::list_apply ( const generic f,
const list< generic > &  l2 
)

Definition at line 104 of file glue_list_map.cpp.

References default_routine(), is_nil(), N(), n, read_car(), and read_cdr().

Referenced by glue_list_map().

                                                       {
  routine fun= is<routine> (f)? as<routine> (f): default_routine (f);
  list<generic> l= l2;
  nat i, n= N(l);
  vector<generic> a= fill<generic> (n);
  for (i=0; !is_nil (l); i++, l= read_cdr(l))
    a[i]= read_car (l);
  return fun->apply (a);
}
generic mmx::list_foreach ( const generic f,
const tuple< list< generic > > &  t 
)

Definition at line 90 of file glue_list_map.cpp.

References gen(), GEN_TUPLE, and list_map().

Referenced by glue_list_map().

                                                                {
  generic r= list_map (f, t);
  return as<generic> (tuple<generic> (gen (GEN_TUPLE)));
}
generic mmx::list_map ( const generic f,
const tuple< list< generic > > &  t 
)

Definition at line 72 of file glue_list_map.cpp.

References ASSERT, cdr(), compound_to_vector(), default_routine(), list_map_1(), list_map_2(), list_map_n(), n, N(), and rebuild().

Referenced by glue_list_map(), and list_foreach().

                                                            {
  routine fun= is<routine> (f)? as<routine> (f): default_routine (f);
  switch (N(t)) {
  case 0: ASSERT (N(t)>0, "wrong number of arguments");
  case 1: return rebuild (list_map_1 (fun, t[0]));
  case 2: return rebuild (list_map_2 (fun, t[0], t[1]));
  default:
    {
      const vector<generic> a= cdr (compound_to_vector (*t));
      nat i, n= N(a);
      vector<list<generic> > b= fill<list<generic> > (n);
      for (i=0; i<n; i++) b[i]= as<list<generic> > (a[i]);
      return rebuild (list_map_n (fun, b));
    }
  }
}
list<generic> mmx::list_map_1 ( const routine fun,
const list< generic > &  l 
)

Definition at line 36 of file glue_list_map.cpp.

References car(), cdr(), cons(), and is_nil().

Referenced by list_map().

                                                        {
  if (is_nil (l)) return l;
  generic r= fun->apply (car (l));
  return cons (r, list_map_1 (fun, cdr (l)));
}
list<generic> mmx::list_map_2 ( const routine fun,
const list< generic > &  l1,
const list< generic > &  l2 
)

Definition at line 43 of file glue_list_map.cpp.

References ASSERT, car(), cdr(), cons(), and is_nil().

Referenced by list_map().

{
  ASSERT (is_nil (l1) == is_nil (l2), "lists of unequal lengths");
  if (is_nil (l1)) return l1;
  generic r= fun->apply (car (l1), car (l2));
  return cons (r, list_map_2 (fun, cdr (l1), cdr (l2)));
}
list<generic> mmx::list_map_n ( const routine fun,
const vector< list< generic > > &  a 
)

Definition at line 53 of file glue_list_map.cpp.

References ASSERT, car(), cdr(), cons(), is_nil(), N(), and n.

Referenced by list_map().

                                                                 {
  nat i, n= N(a);
  vector<generic> cara= fill<generic> (n);
  if (is_nil (a[0])) {
    for (i=0; i<n; i++)
      ASSERT (is_nil (a[i]), "lists of unequal lengths");
    return a[0];
  }
  for (i=0; i<n; i++) {
    ASSERT (!is_nil (a[i]), "lists of unequal lengths");
    cara[i]= car (a[i]);
  }
  vector<list<generic> > cdra= fill<list<generic> > (n);
  for (i=0; i<n; i++) cdra[i]= cdr (a[i]);
  generic r= fun->apply (cara);
  return cons (r, list_map_n (fun, cdra));
}
list<generic> mmx::list_sort ( const list< generic > &  l,
const generic f 
)

Definition at line 123 of file glue_list_map.cpp.

References current_comparison, default_routine(), generic_compare(), and sort().

Referenced by glue_list_map().

                                                     {
  routine old_comparison= current_comparison;
  current_comparison= is<routine> (f)? as<routine> (f): default_routine (f);
  list<generic> r= sort (l, generic_compare);
  current_comparison= old_comparison;
  return r;
}
generic lit ( const string s)

Definition at line 35 of file literal.cpp.

                              {
  return new generic_concrete_rep<literal> (literal (s)); }
string literal_to_string ( const generic g)
bool load ( const string file_name,
string s 
)

Definition at line 433 of file system.cpp.

References decode_name(), and var_load().

                                               {
  return var_load (decode_name (orig_file_name), s);
}
bool load ( const string fp,
const string file_name,
string s 
)

Definition at line 462 of file system.cpp.

References decode_name(), and var_load().

                                                                   {
  return var_load (file_path, decode_name (file_name), s);
}
bool load_directory ( const string name,
vector< string > &  s 
)

Definition at line 476 of file system.cpp.

References as_charp(), decode_name(), free_charp(), and sort().

                                                              {
  string name= decode_name (orig_name);
  DIR* dp;
  char* temp= as_charp (name);
  dp= opendir (temp);
  free_charp (temp);
  dir= vector<string> ();
  if (dp == NULL) return true;

  struct dirent* ep;
  while (true) {
    ep= readdir (dp);
    if (ep == NULL) break;
    dir << string (ep->d_name);
  }
  (void) closedir (dp);
  sort (dir);
  return false;
}
string load_path ( )

Definition at line 115 of file system.cpp.

References get_env(), prefix_dir(), and user_dir().

Referenced by path_name(), and var_load().

             {
  string path= get_env ("MMX_LOAD_PATH");
  if (path != "" && path[0] != ':') path= ":" * path;
  path= ".:" * user_dir () * "/mmx:" * prefix_dir () * "/share:"
             * prefix_dir () * "/share/mmx" * path;
  return path;
}
string locase ( const string s)

Replace upcases by locases.

Definition at line 423 of file string.cpp.

References is_upcase(), n, and N().

Referenced by GLUE_16().

                         {
  nat i, n= N(s);
  string r (n);
  for (i=0; i<n; i++)
    if (!is_upcase (s[i])) r[i]= s[i];
    else r[i]= (char) (((int) ((unsigned char) s[i]))+32);
  return r;
}
string locase_first ( const string s)

Replace upcase by locase for first letter.

Definition at line 441 of file string.cpp.

References copy(), is_upcase(), and N().

Referenced by GLUE_18().

                               {
  string r= copy (s);
  if (N(r) != 0 && is_upcase (s[0]))
    r[0]= (char) (((int) ((unsigned char) s[0]))+32);
  return r;
}
vector<C,V> mmx::log ( const vector< C, V > &  v)

Definition at line 1084 of file vector.hpp.

{ return unary_map<log_op> (v); }
syntactic log ( const syntactic g)

Definition at line 403 of file syntactic.cpp.

References GEN_LOG, and syn().

{ return syn (GEN_LOG, g); }
double log ( const double &  x) [inline]

Definition at line 46 of file double.hpp.

Referenced by acosh(), asinh(), atanh(), GLUE_35(), log_op::op(), set_log2(), and log_op::set_op().

{ return std::log (x); }
generic log ( const generic x1)

Definition at line 438 of file generic.cpp.

References ACC_LOG, ACC_UNARY, current_ev, and GEN_LOG.

                        {
  ACC_UNARY (ACC_LOG, x1);
  return current_ev->apply (GEN_LOG, x1);
}
double log2 ( const double &  x) [inline]

Definition at line 47 of file double.hpp.

Referenced by magnitude(), log2_op::op(), and log2_op::set_op().

{ return ::log2 (x); }
C mmx::log2_cst ( ) [inline]

Definition at line 737 of file type_props.hpp.

References C, and set_log2().

{ C r; set_log2 (r); return r; }
nat mmx::log_2 ( nat  p) [inline]

Definition at line 37 of file int.hpp.

              {
  nat i=0;
  while (p>1) {
    p >>= 1;
    i++;
  }
  return i;
}
nat mmx::log_3 ( nat  p) [inline]

Definition at line 63 of file int.hpp.

              {
  nat i=0;
  while (p>1) {
    p /= 3;
    i++;
  }
  return i;
}
generic log_init ( const generic x,
const generic c 
)

Definition at line 803 of file generic.cpp.

References current_ev.

Referenced by log_op::op_init().

                                                        {
  return current_ev->apply ("log_init", x1, x2); }
syntactic log_init ( const syntactic x,
const syntactic c 
)

Definition at line 465 of file syntactic.cpp.

References syn().

                                                            {
  return syn ("log_init", x, c); }
vector<Center_type(C),V> mmx::lower ( const vector< C, V > &  v)

Definition at line 1162 of file vector.hpp.

                                           {
  return unary_map<lower_op> (v); }
C mmx::lower ( const C &  x) [inline]

Definition at line 911 of file type_props.hpp.

Referenced by lower_op::Center_type(), and lower_op::set_op().

{ return x; }
generic lres ( const generic x1,
const generic x2 
)

Definition at line 841 of file generic.cpp.

References current_ev.

                                                    {
  return current_ev->apply ("lres", x1, x2); }
C mmx::lshift2 ( const C &  x,
const S &  y 
) [inline]

Definition at line 359 of file defaults.hpp.

Referenced by lshift2_op::op(), and lshift2_op::set_op().

{ return x << y; }
C mmx::lshift2 ( const C &  x) [inline]

Definition at line 361 of file defaults.hpp.

{ return lshift2<C,int> (x, 1); }
void mmx::lshift2 ( C &  x,
const C &  y,
const S &  z 
) [inline]

Definition at line 365 of file defaults.hpp.

{ x= y << z; }
void mmx::lshift2_assign ( C &  x,
const S &  y 
) [inline]

Definition at line 363 of file defaults.hpp.

Referenced by lshift2_op::set_op().

{ x <<= y; }
generic lshiftz ( const generic x1,
const generic x2 
)

Definition at line 833 of file generic.cpp.

References current_ev.

                                                       {
  return current_ev->apply ("lshiftz", x1, x2); }
void mmx::lshiftz ( C &  x,
const C &  y,
const S &  z 
) [inline]

Definition at line 382 of file defaults.hpp.

{ x= y << z; }
syntactic lshiftz ( const syntactic g,
const syntactic sh 
)

Definition at line 445 of file syntactic.cpp.

References syn().

                                                            {
  return syn ("lshiftz", g, sh); }
C mmx::lshiftz ( const C &  x,
const S &  y 
) [inline]

Definition at line 376 of file defaults.hpp.

Referenced by sqrt_op::def(), quo_op::def(), div_op::def(), invert_op::def(), lshiftz_op::op(), rshiftz(), and lshiftz_op::set_op().

{ return x << y; }
C mmx::lshiftz ( const C &  x) [inline]

Definition at line 378 of file defaults.hpp.

{ return lshiftz<C,int> (x, 1); }
void mmx::lshiftz_assign ( C &  x,
const S &  y 
) [inline]

Definition at line 380 of file defaults.hpp.

Referenced by rshiftz_assign(), and lshiftz_op::set_op().

{ x <<= y; }
double mmx::magnitude ( const C &  x) [inline]

Definition at line 701 of file defaults.hpp.

References exponent().

Referenced by GLUE_42(), magnitude_op::op(), max_magnitude_op::set_op(), and magnitude_op::set_op().

                                                          {
  return (double) exponent (x); }
double magnitude ( const generic x)

Definition at line 784 of file generic.cpp.

References ASSERT, current_ev, and GEN_MAGNITUDE.

                                    {
  generic r= current_ev->apply (GEN_MAGNITUDE, x);
  ASSERT (is<double> (r), "Double return value expected");
  return as<double> (r); }
STMPL double mmx::magnitude ( const double &  x) [inline]

Definition at line 90 of file double.hpp.

References log2().

{ return log2 (x); }
double mmx::magnitude ( const vector< C, V > &  v) [inline]

Definition at line 1146 of file vector.hpp.

                                               {
  return big<max_magnitude_op> (v); }
generic mmx::make_abstract ( const T &  x) [inline]

Definition at line 53 of file routine.hpp.

References generic_converter< T >::make_abstract().

B mmx::make_ball ( const C &  c,
const R &  r 
)

Definition at line 885 of file type_props.hpp.

References val.

                                   {
  return make_ball_helper<B,C,R>::val (c, r);
}
document make_block ( const vector< document > &  v)

Definition at line 97 of file document.cpp.

References make_document().

Referenced by GLUE_12().

                                       {
  return make_document (v, true);
}
T mmx::make_concrete ( const generic x) [inline]

Definition at line 48 of file routine.hpp.

References generic_converter< T >::make_concrete().

document mmx::make_document ( const vector< document > &  v,
bool  block = false 
)

Definition at line 71 of file document.cpp.

References as_document(), as_documents(), as_generic(), cdr(), compound_to_vector(), gen(), GEN_ROW, is_func(), and N().

Referenced by make_block(), and make_inline().

                                                             {
  //mmout << "v= " << v << indent << lf;
  vector<generic> r;
  if (block) r << generic ("$cr");
  for (nat i=0; i<N(v); i++) {
    generic x= as_generic (v[i]);
    //mmout << "v[" << i << "] = " << x << ": " << type_name (x) << lf;
    if (is_func (x, GEN_ROW)) {
      vector<document> a= as_documents (cdr (compound_to_vector (x)));
      r << as_generic (make_document (a));
      if (i != N(v) - 1) r << generic ("$lf");
    }
    else r << x;
  }
  //mmout << unindent;
  //mmout << "r= " << r << lf;
  if (N (r) == 1) return as_document (r[0]);
  else return as_document (gen ("$concat", r));
}
document make_inline ( const vector< document > &  v)

Definition at line 92 of file document.cpp.

References make_document().

Referenced by GLUE_11().

                                        {
  return make_document (v);
}
B mmx::make_interval ( const C &  l,
const C &  r 
)

Definition at line 907 of file type_props.hpp.

References val.

                                       {
  return make_interval_helper<B,C>::val (l, r);
}
C mmx::make_literal ( const literal lit)

Definition at line 58 of file literal.hpp.

References as_string(), and C.

                                  {
  return C (as_string (lit));
}
document make_math ( const generic x)

Definition at line 55 of file document.cpp.

References as_document(), and gen().

Referenced by GLUE_10(), GLUE_9(), and make_math().

                             {
  return as_document (gen ("$math", x));
}
document make_math ( const document x)

Definition at line 60 of file document.cpp.

References as_generic(), and make_math().

                              {
  return make_math (as_generic (x));
}
document make_row ( const vector< document > &  v)

Definition at line 65 of file document.cpp.

References as_document(), as_generics(), gen(), and GEN_ROW.

Referenced by GLUE_13().

                                     {
  vector<generic> r= as_generics (v);
  return as_document (gen (GEN_ROW, r));
}
document make_texmacs ( const string x,
const vector< document > &  v 
)

Definition at line 102 of file document.cpp.

References as_document(), as_generics(), and gen().

Referenced by GLUE_5(), and GLUE_6().

                                                            {
  return as_document (gen ("tm$" * fun, as_generics (v)));
}
document make_texmacs ( const literal x,
const vector< document > &  v 
)

Definition at line 107 of file document.cpp.

References as_document(), as_generics(), as_string(), and gen().

                                                             {
  return as_document (gen ("tm$" * as_string (fun), as_generics (v)));
}
document make_text ( const generic x)

Definition at line 45 of file document.cpp.

References as_document(), and gen().

Referenced by GLUE_7(), GLUE_8(), and make_text().

                             {
  return as_document (gen ("$text", x));
}
document make_text ( const document x)

Definition at line 50 of file document.cpp.

References as_generic(), and make_text().

                              {
  return make_text (as_generic (x));
}
chain<D> mmx::map ( const function_1< D, Argument(S1) > &  fun,
const chain< S1 > &  c1,
const format< D > &  fm 
)

Definition at line 353 of file chain.hpp.

References is_nil(), left(), middle(), and right().

Referenced by map().

{
  if (is_nil (c1)) return chain<D> (fm);
  return chain<D> (map (fun, left (c1), fm),
                   fun (middle (c1)),
                   map (fun, right (c1), fm));
}
table<C2,T2> mmx::map ( const function_1< T2, Argument(T1) > &  funT,
const function_1< C2, Argument(C1) > &  funC,
const table< C1, T1 > &  t,
const format< T2 > &  fmT,
const format< C2 > &  fmC 
)

Definition at line 586 of file table.hpp.

References busy(), entries(), I(), and simplify().

{
  table<C2,T2> r (funC (I(t)), fmT);
  for (iterator<T1> it= entries (t); busy (it); ++it)
    r[funT(*it)]= funC (t[*it]);
  simplify (r);
  return r;
}
D vector<D> mmx::map ( const function_1< D, Argument(S1) > &  fun,
const vector< S1 > &  v1 
)

Definition at line 873 of file vector.hpp.

References ASSERT, CF(), is_non_scalar(), map(), N(), and n.

                                                                   {
  format<D> fm= map (fun, CF(v1));
  ASSERT (is_non_scalar (v1), "non-scalar vector expected");
  nat n= N(v1);
  nat l= default_aligned_size<D> (n);
  D* r= mmx_formatted_new<D> (l, fm);
  for (nat i=0; i<n; i++) r[i]= fun (v1[i]);
  return vector<D> (r, n, l, fm);
}
vector<D> mmx::map ( D(*)(const S1 &)  fun,
const vector< S1 > &  v1 
)

Definition at line 884 of file vector.hpp.

References ASSERT, CF(), is_non_scalar(), map(), N(), and n.

                                                 {
  format<D> fm= map (fun, CF(v1));
  ASSERT (is_non_scalar (v1), "non-scalar vector expected");
  nat n= N(v1);
  nat l= default_aligned_size<D> (n);
  D* r= mmx_formatted_new<D> (l, fm);
  for (nat i=0; i<n; i++) r[i]= fun (v1[i]);
  return vector<D> (r, n, l, fm);
}
vector<D> mmx::map ( const function_1< D, Argument(S1) > &  fun,
const vector< S1 > &  v1,
const format< D > &  fm 
)

Definition at line 895 of file vector.hpp.

References ASSERT, is_non_scalar(), N(), and n.

{
  ASSERT (is_non_scalar (v1), "non-scalar vector expected");
  nat n= N(v1);
  nat l= default_aligned_size<D> (n);
  D* r= mmx_formatted_new<D> (l, fm);
  for (nat i=0; i<n; i++) r[i]= fun (v1[i]);
  return vector<D> (r, n, l, fm);
}
vector<D> mmx::map ( D(*)(const S1 &)  fun,
const vector< S1 > &  v1,
const format< D > &  fm 
)

Definition at line 907 of file vector.hpp.

References ASSERT, is_non_scalar(), N(), and n.

                                                {
  ASSERT (is_non_scalar (v1), "non-scalar vector expected");
  nat n= N(v1);
  nat l= default_aligned_size<D> (n);
  D* r= mmx_formatted_new<D> (l, fm);
  for (nat i=0; i<n; i++) r[i]= fun (v1[i]);
  return vector<D> (r, n, l, fm);
}
vector<D> mmx::map ( const function_3< D, Argument(S1), Argument(S2), Argument(S3) > &  fun,
const vector< S1 > &  v1,
const vector< S2 > &  v2,
const vector< S3 > &  v3 
)

Definition at line 933 of file vector.hpp.

References ASSERT, is_non_scalar(), n, and N().

{
  format<D> fm; //= map (fun, CF(v1), CF(v2), CF(v3));
  ASSERT (is_non_scalar (v1), "non-scalar vector expected");
  ASSERT (is_non_scalar (v2), "non-scalar vector expected");
  ASSERT (is_non_scalar (v3), "non-scalar vector expected");
  ASSERT (N(v1) == N(v2) && N(v2) == N(v3), "lengths don't match");
  nat n= N(v1);
  nat l= default_aligned_size<D> (n);
  D* r= mmx_formatted_new<D> (l, fm);
  for (nat i=0; i<n; i++) r[i]= fun (v1[i], v2[i], v3[i]);
  return vector<D> (r, n, l, fm);
}
chain<D> mmx::map ( D(*)(const S1 &)  fun,
const chain< S1 > &  x1,
const format< D > &  fm 
) [inline]

Definition at line 363 of file chain.hpp.

References Argument, map(), and S1.

                                                                     {
  return map (function_1<D,Argument(S1) > (fun), x1, fm);
}
format<R> mmx::map ( const function_1< R, C > &  fun,
const format< C > &  fm 
)

Definition at line 184 of file function.hpp.

References format_function_helper< FT, R, C, Fun >::op().

                                                                 {
  typedef function_1<R,Argument(C) > Fun;
  typedef typename format<R>::FT FT;
  return format_function_helper<FT,R,C,Fun>::op (fun, fm);
}
format<R> mmx::map ( R(*)(const C &)  fun,
const format< C > &  fm 
)

Definition at line 191 of file function.hpp.

References C, and format_function_helper< FT, R, C, Fun >::op().

                                               {
  typedef R (*Fun) (const C&);
  typedef typename format<R>::FT FT;
  return format_function_helper<FT,R,C,Fun>::op (fun, fm);
}
list<D> mmx::map ( const function_1< D, Argument(S1) > &  fun,
const list< S1 > &  l1,
const format< D > &  fm 
)

Definition at line 336 of file list.hpp.

References car(), cdr(), cons(), is_nil(), and map().

{
  if (is_nil (l1)) return list<D> (fm);
  else return cons (fun (car (l1)), map (fun, cdr (l1), fm));
}
list<D> mmx::map ( D(*)(const S1 &)  fun,
const list< S1 > &  x1,
const format< D > &  fm 
) [inline]

Definition at line 344 of file list.hpp.

References Argument, map(), and S1.

                                              {
  return map (function_1<D,Argument(S1) > (fun), x1, fm);
}
vector<D> mmx::map ( const function_2< D, Argument(S1), Argument(S2) > &  fun,
const vector< S1 > &  v1,
const vector< S2 > &  v2 
)

Definition at line 918 of file vector.hpp.

References ASSERT, is_non_scalar(), n, and N().

{
  format<D> fm; //= map (fun, CF(v1), CF(v2));
  ASSERT (is_non_scalar (v1), "non-scalar vector expected");
  ASSERT (is_non_scalar (v2), "non-scalar vector expected");
  ASSERT (N(v1) == N(v2), "lengths don't match");
  nat n= N(v1);
  nat l= default_aligned_size<D> (n);
  D* r= mmx_formatted_new<D> (l, fm);
  for (nat i=0; i<n; i++) r[i]= fun (v1[i], v2[i]);
  return vector<D> (r, n, l, fm);
}
static table<string, string, exact_eq_table> mmx::math_symbol_table ( ) [static]

Definition at line 24 of file math_printer.cpp.

References GEN_ACCESS, GEN_AND, GEN_APPEND, GEN_CATALAN, GEN_COMPOSE, GEN_DELTA, GEN_DERIVATIVE, GEN_DIV, GEN_DOT, GEN_DOWNTO, GEN_E, GEN_EQUAL, GEN_EQUIV, GEN_EULER, GEN_FACTORIAL, GEN_GTR, GEN_GTREQ, GEN_GTRGTR, GEN_I, GEN_IMPLIES, GEN_IN, GEN_INFINITY, GEN_INTO, GEN_LESS, GEN_LESSEQ, GEN_LESSLESS, GEN_MAPSTO, GEN_MINUS, GEN_MOD, GEN_NOT, GEN_OR, GEN_OVER, GEN_PARTIAL, GEN_PI, GEN_PLUS, GEN_POWER, GEN_PRIME, GEN_RANGE, GEN_ROW, GEN_SCOPE, GEN_SEQAND, GEN_SEQOR, GEN_SIZE, GEN_SQTUPLE, GEN_TIMES, GEN_TO, GEN_TRANSTYPE, GEN_TUPLE, GEN_UNEQUAL, GEN_VWHERE, GEN_WHERE, GEN_XOR, and SET_OPNAME.

Referenced by as_math().

                     {
  table<string, string, exact_eq_table> t;

  SET_OPNAME (GEN_ACCESS, "_"); // or "%sqaccess"
  SET_OPNAME (GEN_AND, "/\\");
  SET_OPNAME (GEN_CATALAN, "%mathcatalan");
  SET_OPNAME (GEN_COMPOSE, "%circ");
  SET_OPNAME (GEN_APPEND, "%join");
  SET_OPNAME (GEN_DELTA, "%delta");
  SET_OPNAME (GEN_DERIVATIVE, "D");
  SET_OPNAME (GEN_DOT, "%dotaccess");
  SET_OPNAME (GEN_DIV, "div");
  SET_OPNAME (GEN_E, "%mathe");
  SET_OPNAME (GEN_EQUAL, "=");
  SET_OPNAME (GEN_EQUIV, "<=>");
  SET_OPNAME (GEN_EULER, "%matheuler");
  SET_OPNAME (GEN_FACTORIAL, "factorial");
  SET_OPNAME (GEN_GTR, ">");
  SET_OPNAME (GEN_GTREQ, ">=");
  SET_OPNAME (GEN_GTRGTR, ">>");
  SET_OPNAME (GEN_I, "%mathi");
  SET_OPNAME (GEN_IMPLIES, "=>");
  SET_OPNAME (GEN_IN, "%in");
  SET_OPNAME (GEN_INFINITY, "%infty");
  SET_OPNAME (GEN_INTO, "->");
  SET_OPNAME (GEN_LESS, "<");
  SET_OPNAME (GEN_LESSEQ, "<=");
  SET_OPNAME (GEN_LESSLESS, "<<");
  SET_OPNAME (GEN_MAPSTO, "#{:->}#");
  SET_OPNAME (GEN_MINUS, "-");
  SET_OPNAME (GEN_MOD, "mod");
  SET_OPNAME (GEN_NOT, "!");
  SET_OPNAME (GEN_OR, "\\/");
  SET_OPNAME (GEN_OVER, "/");
  SET_OPNAME (GEN_PARTIAL, "%partial");
  SET_OPNAME (GEN_PI, "%mathpi");
  SET_OPNAME (GEN_PLUS, "+&");
  SET_OPNAME (GEN_POWER, "^");
  SET_OPNAME (GEN_PRIME, "%prime");
  SET_OPNAME (GEN_RANGE, "%ldots"); // problem with iterator flattening
  SET_OPNAME (GEN_SCOPE, "%colons");
  SET_OPNAME (GEN_TO, "to");
  SET_OPNAME (GEN_DOWNTO, "downto");
  SET_OPNAME (GEN_ROW, "row");
  SET_OPNAME (GEN_SEQAND, "and");
  SET_OPNAME (GEN_SEQOR, "or");
  SET_OPNAME (GEN_SIZE, "%card");
  SET_OPNAME (GEN_SQTUPLE, "list");
  SET_OPNAME (GEN_TIMES, "*&");
  SET_OPNAME (GEN_TRANSTYPE, "#{:>}#");
  SET_OPNAME (GEN_TUPLE, "tuple");
  //SET_OPNAME (GEN_TYPE, "#{:}#");
  SET_OPNAME (GEN_UNEQUAL, "!=");
  SET_OPNAME (GEN_VWHERE, "|");
  SET_OPNAME (GEN_WHERE, "||");
  SET_OPNAME (GEN_XOR, "%veebar");

  t["alpha"] = "%alpha";
  t["beta"] = "%beta";
  t["gamma"] = "%gamma";
  t["delta"] = "%delta";
  t["epsilon"] = "%varepsilon";
  t["zeta"] = "%zeta";
  t["eta"] = "%eta";
  t["theta"] = "%theta";
  t["iota"] = "%iota";
  t["kappa"] = "%kappa";
  t["lambda"] = "%lambda";
  t["mu"] = "%mu";
  t["nu"] = "%nu";
  t["xi"] = "%xi";
  t["omicron"] = "%omicron";
  t["pi"] = "%pi";
  t["rho"] = "%rho";
  t["sigma"] = "%sigma";
  t["tau"] = "%tau";
  t["upsilon"] = "%upsilon";
  t["phi"] = "%varphi";
  t["chi"] = "%chi";
  t["psi"] = "%psi";
  t["omega"] = "%omega";

  t["Alpha"] = "%Alpha";
  t["Beta"] = "%Beta";
  t["Gamma"] = "%Gamma";
  t["Delta"] = "%Delta";
  t["Epsilon"] = "%Epsilon";
  t["Zeta"] = "%Zeta";
  t["Eta"] = "%Eta";
  t["Theta"] = "%Theta";
  t["Iota"] = "%Iota";
  t["Kappa"] = "%Kappa";
  t["Lambda"] = "%Lambda";
  t["Mu"] = "%Mu";
  t["Nu"] = "%Nu";
  t["Xi"] = "%Xi";
  t["Omicron"] = "%Omicron";
  t["Pi"] = "%Pi";
  t["Rho"] = "%Rho";
  t["Sigma"] = "%Sigma";
  t["Tau"] = "%Tau";
  t["Upsilon"] = "%Upsilon";
  t["Phi"] = "%Phi";
  t["Chi"] = "%Chi";
  t["Psi"] = "%Psi";
  t["Omega"] = "%Omega";
  return t;
}
generic max ( const generic x1,
const generic x2 
)

Definition at line 727 of file generic.cpp.

References current_ev, and GEN_MAX.

                                                   {
  return current_ev->apply (GEN_MAX, x1, x2); }
source_position mmx::max ( const source_position &  p1,
const source_position &  p2 
) [inline]

Definition at line 53 of file source_track.hpp.

References source_position::position.

                                                           {
  return p1.position > p2.position? p1: p2;
};
C mmx::maximal_cst ( ) [inline]

Definition at line 757 of file type_props.hpp.

References C, and set_maximal().

{ C r; set_maximal (r); return r; }
void mmx::mem_copy ( char *  d,
char *  s,
nat  n 
) [inline]

Definition at line 112 of file string.hpp.

References n.

Referenced by input_output_string_port_rep::read(), input_string_port_rep::read(), and posix_port_rep::read().

                                               {
  for (nat i=0; i<n; i++) d[i]= s[i]; }
list<C> mmx::merge ( const list< C > &  head,
const list< C > &  tail,
int(*)(const C &, const C &)  cmp 
)

Merge head and tail that are supposed to be ordered increasingly wrt cmp.

Definition at line 41 of file list_sort.hpp.

References car(), cdr(), cons(), and is_nil().

Referenced by sort().

                                                                            {
  if (is_nil (head)) return tail;
  if (is_nil (tail)) return head;
  if (cmp (car (head), car (tail)) <= 0)
    return cons (car (head), merge (cdr (head), tail, cmp));
  return cons (car (tail), merge (head, cdr (tail), cmp));
}
void message ( const dynamic d,
const generic msg 
)

Definition at line 41 of file dynamic.cpp.

References N().

                                               {
  for (nat i=0; i<N(d->obs); i++)
    d->obs[i]->message (msg);
}
syntactic migrate_negate ( const syntactic g,
nat  maximal 
)

Definition at line 220 of file syntactic.cpp.

References GEN_MINUS, GEN_PLUS, is_func(), migrate_sub(), and signed_decompose().

Referenced by ordered_sum().

                                                 {
  int i= 0, found= -1;
  syntactic h= g;
  while (is_func (h, GEN_PLUS, 2) || is_func (h, GEN_MINUS, 2)) {
    if (is_func (h, GEN_PLUS, 2)) found= i;
    if (maximal == 0) return g;
    h= h[1];
    maximal--;
    i++;
  }
  if (found == -1) return g;
  syntactic abs_h; int sgn_h;
  signed_decompose (h, abs_h, sgn_h);
  if (sgn_h >= 0) return g;
  return migrate_sub (g, found);
}
static syntactic mmx::migrate_sub ( const syntactic g,
const syntactic h 
) [static]

Definition at line 205 of file syntactic.cpp.

References GEN_MINUS, is_func(), signed_decompose(), and syn().

Referenced by migrate_negate(), and migrate_sub().

                                                     {
  if (is_func (g, GEN_MINUS, 2))
    return syn (GEN_MINUS, migrate_sub (g[1], h), g[2]);
  syntactic abs_g; int sgn_g;
  signed_decompose (g, abs_g, sgn_g);
  return syn (GEN_MINUS, h, abs_g);
}
static syntactic mmx::migrate_sub ( const syntactic g,
nat  found 
) [static]

Definition at line 214 of file syntactic.cpp.

References migrate_sub(), and syn().

                                            {
  if (found == 0) return migrate_sub (g[1], g[2]);
  return syn (g[0], migrate_sub (g[1], found-1), g[2]);
}
generic min ( const generic x1,
const generic x2 
)

Definition at line 725 of file generic.cpp.

References current_ev, and GEN_MIN.

                                                   {
  return current_ev->apply (GEN_MIN, x1, x2); }
source_position mmx::min ( const source_position &  p1,
const source_position &  p2 
) [inline]

Definition at line 48 of file source_track.hpp.

References source_position::position.

                                                           {
  return p1.position < p2.position? p1: p2;
};
C mmx::minimal_cst ( ) [inline]

Definition at line 759 of file type_props.hpp.

References C, and set_minimal().

{ C r; set_minimal (r); return r; }
bool mkdir ( const string orig_name)

Definition at line 519 of file system.cpp.

References decode_name(), and var_mkdir().

Referenced by var_mkdir().

                           {
  return var_mkdir (decode_name (name));
}
void mmx::mmx_classical_delete ( C *  Ptr) [inline]

Definition at line 331 of file fast_new.hpp.

References C, mmx_free(), and n.

                              {
  void* ptr= (void*) (((nat*) ((void*) Ptr)) - 1);
  nat n= *((nat*) ptr);
  C* ctr= Ptr+n-1;
  for (nat i=0; i<n; i++, ctr--) ctr -> ~C();
  mmx_free (ptr, n * sizeof (C) + sizeof (nat));
}
C* mmx::mmx_classical_new ( nat  n) [inline]

Definition at line 320 of file fast_new.hpp.

References C, mmx_malloc(), and n.

                          {
  void* ptr= mmx_malloc (n * sizeof (C) + sizeof (nat));
  *((nat*) ptr)= n;
  ptr= (void*) (((nat*) ptr) + 1);
  C* ctr= (C*) ptr;
  for (nat i=0; i<n; i++, ctr++)
    (void) new ((void*) ctr) C ();
  return (C*) ptr;
}
nat mmx::mmx_cpu_time ( ) [inline]

Number of cycles of the cpu.

Definition at line 48 of file timer.hpp.

                           {
  return (nat) clock ();
}
string mmx::mmx_cpu_time_unit ( ) [inline]

Definition at line 52 of file timer.hpp.

{ return("tk"); };
void mmx::mmx_delete ( C *  Ptr,
nat  n 
) [inline]

Definition at line 285 of file fast_new.hpp.

References C, mmx_free(), and n.

Referenced by vector< observer >::vector().

                           {
#ifdef BASIX_ENABLE_VERIFY
  void* ptr= (void*) Ptr;
  //printf ("{--%p}", ptr); fflush (stdout);
  ptr= (void*) (((char*) ptr) - 16);
  //printf ("{-%p}", ptr); fflush (stdout);
  if (*((nat*) ptr) != n)
    printf ("[%u should be %u]\n", n, *((nat*) ptr));
  assert (*((nat*) ptr) == n);
  C* ctr= Ptr+n-1;
  for (nat i=0; i<n; i++, ctr--) ctr -> ~C();
  mmx_free (ptr, n * sizeof (C) + 16);
#else
  C* ctr= Ptr+n-1;
  for (nat i=0; i<n; i++, ctr--) ctr -> ~C();
  mmx_free ((void*) Ptr, n * sizeof (C));
#endif
}
void mmx::mmx_delete_one ( C *  ptr) [inline]

Definition at line 315 of file fast_new.hpp.

                        {
  mmx_delete<C> (ptr, 1);
}
T* mmx::mmx_formatted_new ( nat  l,
const format< T > &  fm 
) [inline]

Definition at line 501 of file type_props.hpp.

                                               {
  typedef typename format<T>::FT FT;
  return formatted_new_helper<FT,T>::op (l, fm);
}
void mmx::mmx_free ( void *  ptr,
size_t  old_size 
) [inline]
void mmx::mmx_free_thread_safe ( void *  ptr,
size_t  old_size 
) [inline]

Definition at line 193 of file fast_new.hpp.

References memory_lock, and mmx_free_thread_unsafe().

Referenced by mmx_free().

                                                  {
  mutex_lock lock (memory_lock);
  mmx_free_thread_unsafe (ptr, old_size); }
void mmx::mmx_free_thread_unsafe ( register void *  ptr,
register size_t  sz 
)

Referenced by mmx_free(), and mmx_free_thread_safe().

int mmx_lex ( generic lval,
parse_instance obj 
)

Definition at line 79 of file mmx_lexer.cpp.

References ADD_POS, HAS, IN, INC_LINE, INC_POS, is_alpha(), keyword(), n, pos, PREFIX, produce, s, SAVE_START, SET_PREV, and test.

                                             {
  if (pos == n) {
    s= NULL;
    *lval= generic ();
    return 0;
  }

  SET_PREV;
  char c= s[pos];
  while ((c<=' ') || (c>'~')) {
    if ((c == '\n') || (c == '\r')) 
      INC_LINE
    else
      INC_POS;
    if (pos == n) {
      s= NULL;
      *lval= generic ();
      return 0;
    }
    c= s[pos];
  }

  SAVE_START;
  INC_POS;
  switch (c) {
  case '!':
    test ('=', NOT_EQUAL);
    if ((pos<n) && (s[pos]=='<')) {
      INC_POS;
      test ('=', NOT_LEQ);
      produce (NOT_LESS);
    }
    if ((pos<n) && (s[pos]=='>')) {
      INC_POS;
      test ('=', NOT_GEQ);
      produce (NOT_GREATER);
    }
    produce (NOT);
  case '\042':
    while (pos<n) {
      if ((s[pos]=='\\') && ((pos+2)<n)) { ADD_POS(2); continue; }
      if (s[pos]=='\n' || (s[pos]=='\r')) { INC_LINE; continue; }
      if (s[pos]=='\042') { INC_POS; break; }
      INC_POS;
    }
    produce (STRING);
  case '#':
    produce (SIZE);
  case '$':
    goto identifier;
  case '%':
    produce (PERCENT);
  case '&':
    produce (AMPERSAND);
  case '\047':
    produce (QUOTE);
  case '(':
  case ')':
    produce (c);
  case '*':
    test ('=', TIMES_ASSIGN);
    produce (TIMES);
  case '+':
    test ('=', PLUS_ASSIGN);
    test ('+', INC);
    produce (PLUS);
  case ',':
    produce (c);
  case '-':
    test ('=', MINUS_ASSIGN);
    test ('-', DEC);
    test ('>', INTO);
    produce (MINUS);
  case '.':
    test ('.', RANGE);
    produce (ACCESS);
  case '/':
    test ('\\', AND);
    if (s[pos]=='/') {
      INC_POS;
      while ((pos<n) && (s[pos]!='\n')) {
        INC_POS;
      }
      if (pos<n) { INC_LINE; }
      return mmx_lex (lval, obj);
    }
    if (s[pos]=='{') {
      nat level= 1;
      INC_POS;
      while ((pos+1<n) && (level>0)) {
        if (s[pos]=='\n' || (s[pos]=='\r')) {
          INC_LINE; continue; }
        if ((s[pos]=='/') && (s[pos+1]=='{')) {
          level++; ADD_POS(2); continue; }
        if ((s[pos]=='}') && (s[pos+1]=='/')) {
          level--; ADD_POS(2); continue; }
        INC_POS;
      }
      if (level>0) pos=n;
      return mmx_lex (lval, obj);
    }
    if (s[pos] == '\"') {
      INC_POS;
      while ((pos+1<n) && ((s[pos]!='\"') || (s[pos+1]!='/'))) {
        if (s[pos]=='\n' || (s[pos]=='\r')) {
          INC_LINE; }
        else {
          INC_POS; }
      }
      if (pos+1 < n) {
        ADD_POS(2);
      }
      produce (STRING);
    }
    test ('=', OVER_ASSIGN);
    produce (OVER);
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    while ((pos<n) && (s[pos]>='0') && (s[pos]<='9')) INC_POS;
    if ((pos<n+1) && (s[pos]=='.') && (s[pos+1]>='0') && (s[pos+1]<='9')) {
      ADD_POS(2);
      while ((pos<n) && (s[pos]>='0') && (s[pos]<='9')) INC_POS;
      if ((pos<n+1) && ((s[pos]=='e') || (s[pos]=='E'))) {
        nat p= ((pos<n+2) && (s[pos+1]=='-') ? 2: 1);
        if ((s[pos+p]>='0') && (s[pos+p]<='9')) {
          ADD_POS(p);
          while ((pos<n) && (s[pos]>='0') && (s[pos]<='9')) INC_POS;
        }
      }
      produce (FLOATING);
    }
    else produce (INTEGER);
  case ':':
    if ((pos<n) && (s[pos]=='=')) {
      if ((pos+1<n) && (s[pos+1]=='>')) {
        ADD_POS(2); produce (ASSIGN_MACRO); }
      INC_POS; produce (ASSIGN);
    }
    test ('>', TRANSTYPE);
    test (':', SCOPE);
    if ((pos+1<n) && (s[pos]=='-') && (s[pos+1]=='>')) {
      ADD_POS(2); produce (MAPSTO);
    }
    produce (TYPE);
  case ';':
    produce (c);
  case '<':
    if ((pos<n) && (s[pos]=='<')) {
      if ((pos+1<n) && (s[pos+1]=='<')) {
        ADD_POS(2); produce (LEFT_FLUX_BIN); }
      if ((pos+1<n) && (s[pos+1]=='*')) {
        ADD_POS(2); produce (LEFT_FLUX_VAR); }
      if ((pos+1<n) && (s[pos+1]=='%')) {
        ADD_POS(2); produce (LEFT_FLUX_STR); }
      if ((pos+1<n) && (s[pos+1]=='=')) {
        ADD_POS(2); produce (LL_ASSIGN); }
      INC_POS; produce (LEFT_FLUX);
    }
    if ((pos+1<n) && (s[pos]=='=') && (s[pos+1]=='>')) {
      ADD_POS(2); produce (EQUIVALENT);
    }
    test ('=', LEQ);
    produce (LESS);
  case '=':
    if ((pos<n) && (s[pos]=='=')) {
      if ((pos+1<n) && (s[pos+1]=='>')) {
        ADD_POS(2); produce (DEFINE_MACRO); }
      INC_POS; produce (DEFINE);
    }
    test ('>', IMPLIES);
    produce (EQUAL);
  case '>':
    test ('<', APPEND);
    if ((pos<n) && (s[pos]=='>')) {
      if ((pos+1<n) && (s[pos+1]=='>')) {
        ADD_POS(2); produce (RIGHT_FLUX_BIN); }
      if ((pos+1<n) && (s[pos+1]=='=')) {
        ADD_POS(2); produce (GG_ASSIGN); }
      INC_POS; produce (RIGHT_FLUX);
    }
    test ('=', GEQ);
    produce (GREATER);
  case '?':
    goto identifier;
  case '@':
    test ('+', OPLUS);
    test ('-', OMINUS);
    test ('*', OTIMES);
    test ('/', OOVER);
    produce (COMPOSE);
  case 'A':
  case 'B':
  case 'C':
  case 'D':
  case 'E':
  case 'F':
  case 'G':
  case 'H':
  case 'I':
  case 'J':
  case 'K':
  case 'L':
  case 'M':
  case 'N':
  case 'O':
  case 'P':
  case 'Q':
  case 'R':
  case 'S':
  case 'T':
  case 'U':
  case 'V':
  case 'W':
  case 'X':
  case 'Y':
  case 'Z':
    goto identifier;
  case '[':
    produce (c);
  case '\\':
    test ('/', OR);
    produce (c);
  case ']':
    produce (c);
  case '^':
    test ('^', FILL);
    produce (POWER);
  case '_':
    goto identifier;
  case '`':
    produce (BACKQUOTE);
  case 'a':
    if (pos<n) {
      keyword ('b', "abstract", ABSTRACT);
      keyword ('d', "add", ADD);
      keyword ('n', "and", SEQAND);
      keyword ('s', "assume", ASSUME);
    }
    goto identifier;
  case 'b':
    if (pos<n) keyword ('r', "break", BREAK);
    goto identifier;
  case 'c':
    if ((pos+3)<n) {
      if (s[pos]=='a') {
        INC_POS;
        keyword ('s', "case", CASE);
        if (s[pos] == 't') {
          INC_POS;
          keyword ('c', "catch", CATCH);
          keyword ('e', "category", CATEGORY);
        }
      }
      keyword ('l', "class", CLASS);
      if ((s[pos]=='o') && (s[pos+1]=='n')) {
        ADD_POS(2);
        keyword ('c', "concrete", CONCRETE);
        if (((pos+1)<n) && s[pos]=='s' && s[pos+1]=='t') {
          ADD_POS(2);
          keyword ('a', "constant", CONSTANT);
          keyword ('r', "constructor", CONSTRUCTOR);
        }
        keyword ('t', "continue", CONTINUE);
      }
    }
    goto identifier;
  case 'd':
    if (pos<n) {
      keyword ('e', "destructor", DESTRUCTOR);
      if (s[pos]=='i') {
        INC_POS;
        keyword ('r', "direct", DIRECT);
        keyword ('v', "div", DIV);
      }
      if (s[pos]=='o') {
        INC_POS;
        if ((pos >= n) || (!is_alpha (s[pos]))) produce (DO);
        keyword ('w', "downto", DOWNTO);
      }
    }
    goto identifier;
  case 'e':
    if ((pos+1)<n) {
      keyword ('l', "else", ELSE);
      keyword ('v', "evolutive", EVOLUTIVE);
      if (s[pos]=='x') {
        INC_POS;
        keyword ('i', "exists", EXISTS);
        keyword ('p', "export", EXPORT);
        if (((pos+2)<n) && (s[pos]=='t') && (s[pos+1]=='e')) {
          ADD_POS(2);
          keyword ('n', "extend", EXTEND);
          keyword ('r', "extern", EXTERN);
        }
      }
    }
    goto identifier;
  case 'f':
    if (pos<n) {
      if ((pos+1<n) && (s[pos]=='o') && (s[pos+1]=='r')) {
        if ((pos+2<n) && (s[pos+2]=='a')) {
          keyword ('o', "forall", FORALL); }
        else if ((pos+2<n) && (s[pos+2]=='e')) {
          keyword ('o', "foreign", FOREIGN); }
        else {
          keyword ('o', "for", FOR); }
      }
      keyword ('r', "from", FROM);
    }
    goto identifier;
  case 'g':
    if (pos<n) keyword ('e', "generate", GENERATE);
    goto identifier;
  case 'h':
    if (pos<n) {
      keyword ('a', "has", HAS);
      keyword ('i', "hidden", HIDDEN);
      keyword ('o', "holds", HOLDS);
    }
    goto identifier;
  case 'i':
    if (pos<n) {
      keyword ('f', "if", IF);
      keyword ('m', "import", IMPORT);
      if (s[pos]=='n') {
        INC_POS;
        if ((pos >= n) || (!is_alpha (s[pos]))) produce (IN);
        keyword ('d', "indirect", INDIRECT);
        keyword ('f', "infix", INFIX);
        keyword ('h', "inherit", INHERIT);
        keyword ('l', "inline", INLINE);
        keyword ('p', "inplace", INPLACE);
        if ((pos+3<n) && (s[pos]=='t') && (s[pos+1]=='e') && (s[pos+2]=='r')) {
          ADD_POS(3);
          keyword ('a', "interactive", INTERACTIVE);
          keyword ('n', "intern", INTERN);
        }
      }
    }
    goto identifier;
  case 'j':
    if (pos<n) keyword ('o', "join", JOIN);
    goto identifier;
  case 'k':
    if (pos<n) keyword ('e', "keyword", KEYWORD);
    goto identifier;
  case 'l':
    if (pos<n) {
      keyword ('a', "lambda", LAMBDA);
      keyword ('i', "literal", LITERAL);
      if (((pos+1)<n) && (s[pos]=='o')) {
        INC_POS;
        keyword ('c', "locked", LOCKED);
        keyword ('o', "loop", LOOP);
      }
    }
    goto identifier;
  case 'm':
    if (pos<n) {
      keyword ('a', "macro", MACRO);
      keyword ('e', "method", METHOD);
      if (((pos+1)<n) && (s[pos]=='o') && (s[pos+1]=='d')) {
        if ((pos+2<n) && (s[pos+2]=='u')) {
          keyword ('o', "module", MODULE); }
        else {
          keyword ('o', "mod", MOD); }
      }
      keyword ('u', "mutable", MUTABLE);
    }
    goto identifier;
  case 'n':
    goto identifier;
  case 'o':
    if (pos<n) {
      keyword ('p', "operator", OPERATOR);
      keyword ('r', "or", SEQOR);
      keyword ('u', "outline", OUTLINE);
    }
    goto identifier;
  case 'p':
    if ((pos+1)<n) {
      keyword ('a', "packed", PACKED);
      keyword ('e', "penalty", PENALTY);
      keyword ('o', "postfix", POSTFIX);
      if (s[pos]=='r') {
        INC_POS;
        keyword ('e', "prefix", PREFIX);
        keyword ('i', "private", PRIVATE);
        keyword ('o', "protected", PROTECTED);
      }
      keyword ('u', "public", PUBLIC);
    }
    goto identifier;
  case 'q':
    if (pos<n) keyword ('u', "quo", QUO);
    goto identifier;
  case 'r':
    if ((pos+1)<n) {
      keyword ('a', "raise", RAISE);
      if (s[pos]=='e') {
        INC_POS;
        keyword ('m', "rem", REM);
        keyword ('t', "return", RETURN);
      }
    }
    goto identifier;
  case 's':
    if (pos<n) {
      keyword ('e', "sequel", SEQUEL);
      keyword ('p', "split", SPLIT);
      keyword ('t', "step", STEP);
    }
    goto identifier;
  case 't':
    if ((pos+1)<n) {
      if (s[pos]=='h') {
        INC_POS;
        keyword ('e', "then", THEN);
        keyword ('i', "this", THIS);
      }
      keyword ('r', "try", TRY);
      keyword ('o', "to", TO);
    }
    goto identifier;
  case 'u':
    if (((pos+1)<n) && (s[pos]=='n')) {
      INC_POS;
      keyword ('p', "unpacked", UNPACKED);
      keyword ('t', "until", UNTIL);
    }
    goto identifier;
  case 'v':
    if (((pos+1)<n) && (s[pos]=='a')) {
      INC_POS;
      keyword ('l', "value", VALUE);
    }
    goto identifier;
  case 'w':
    if (pos<n) {
      keyword ('h', "while", WHILE);
      keyword ('i', "with", WITH);
    }
    goto identifier;
  case 'x':
    if (pos<n) keyword ('o', "xor", XOR);
    goto identifier;
  case 'y':
    if (pos<n) keyword ('i', "yield", YIELD);
    goto identifier;
  case 'z':
    goto identifier;
  case '{':
    produce (c);
  case '|':
    test ('|', VWHERE);
    produce (WHERE);
  case '}':
    produce (c);
  case '~':
    test ('>', CONVERTS);
    produce (TILDA);
  default:
    return mmx_lex (lval, obj);

  identifier:
    while ((pos<n) && is_alpha (s[pos])) INC_POS;
    produce (IDENTIFIER);
  }
}
void* mmx::mmx_malloc ( size_t  sz) [inline]
void* mmx::mmx_malloc_thread_safe ( size_t  new_size) [inline]

Definition at line 183 of file fast_new.hpp.

References memory_lock, and mmx_malloc_thread_unsafe().

Referenced by mmx_malloc().

                                         {
  mutex_lock lock (memory_lock);
  return mmx_malloc_thread_unsafe (new_size); }
void* mmx::mmx_malloc_thread_unsafe ( register size_t  sz)
C* mmx::mmx_new ( nat  n) [inline]

Definition at line 234 of file fast_new.hpp.

References C, mmx_malloc(), and n.

Referenced by REP_STRUCT_2().

                {
#ifdef BASIX_ENABLE_VERIFY
  void* ptr= mmx_malloc (n * sizeof (C) + 16);
  *((nat*) ptr)= n;
  //printf ("{+%p}", ptr); fflush (stdout);
  ptr= (void*) (((char*) ptr) + 16);
  //printf ("{++%p}", ptr); fflush (stdout);
#else
  void* ptr= mmx_malloc (n * sizeof (C));
#endif
  C* ctr= (C*) ptr;
  for (nat i=0; i<n; i++, ctr++)
    (void) new ((void*) ctr) C ();
  return (C*) ptr;
}
C* mmx::mmx_new ( nat  n,
const T1 &  a1,
const T2 &  a2 
) [inline]

Definition at line 268 of file fast_new.hpp.

References C, mmx_malloc(), and n.

                                            {
#ifdef BASIX_ENABLE_VERIFY
  void* ptr= mmx_malloc (n * sizeof (C) + 16);
  *((nat*) ptr)= n;
  //printf ("{..+%p}", ptr); fflush (stdout);
  ptr= (void*) (((char*) ptr) + 16);
  //printf ("{..++%p}", ptr); fflush (stdout);
#else
  void* ptr= mmx_malloc (n * sizeof (C));
#endif
  C* ctr= (C*) ptr;
  for (nat i=0; i<n; i++, ctr++)
    (void) new ((void*) ctr) C (a1, a2);
  return (C*) ptr;
}
C* mmx::mmx_new ( nat  n,
const T1 &  a1 
) [inline]

Definition at line 251 of file fast_new.hpp.

References C, mmx_malloc(), and n.

                              {
#ifdef BASIX_ENABLE_VERIFY
  void* ptr= mmx_malloc (n * sizeof (C) + 16);
  *((nat*) ptr)= n;
  //printf ("{.+%p}", ptr); fflush (stdout);
  ptr= (void*) (((char*) ptr) + 16);
  //printf ("{.++%p}", ptr); fflush (stdout);
#else
  void* ptr= mmx_malloc (n * sizeof (C));
#endif
  C* ctr= (C*) ptr;
  for (nat i=0; i<n; i++, ctr++)
    (void) new ((void*) ctr) C (a1);
  return (C*) ptr;
}
C* mmx::mmx_new_one ( ) [inline]

Definition at line 305 of file fast_new.hpp.

               {
  return mmx_new<C> (1);
}
C* mmx::mmx_new_one ( const T1 &  a1) [inline]

Definition at line 310 of file fast_new.hpp.

                           {
  return mmx_new<C> (1, a1);
}
generic mmx::mmx_parse ( const string file_name,
nat  input_number,
const string s,
list< generic > &  errors 
)
generic mmx::mmx_parse ( const string file_name,
const string s 
)
void* mmx::mmx_realloc ( void *  ptr,
size_t  old_size,
size_t  new_size 
) [inline]

Definition at line 203 of file fast_new.hpp.

References mmx_realloc_thread_safe(), mmx_realloc_thread_unsafe(), and threads_active.

                                                          {
  return threads_active ? mmx_realloc_thread_safe   (ptr, old_size, new_size)
                        : mmx_realloc_thread_unsafe (ptr, old_size, new_size);}
void* mmx::mmx_realloc_thread_safe ( void *  ptr,
size_t  old_size,
size_t  new_size 
) [inline]

Definition at line 188 of file fast_new.hpp.

References memory_lock, and mmx_realloc_thread_unsafe().

Referenced by mmx_realloc().

                                                                      {
  mutex_lock lock (memory_lock);
  return mmx_realloc_thread_unsafe (ptr, old_size, new_size); }
void* mmx::mmx_realloc_thread_unsafe ( register void *  old_ptr,
register size_t  old_sz,
register size_t  new_sz 
)
static table<generic,generic> mmx::mmx_symbol_table ( ) [static]

Definition at line 158 of file mmx_printer.cpp.

References init().

Referenced by serialize().

                    {
  table<generic,generic> t;
  init (t, "mathcatalan", "K");
  init (t, "partial", "d");
  init (t, "derivative", "D");
  init (t, "matheuler", "gamma");
  init (t, "mathd", "d");
  init (t, "mathe", "e");
  init (t, "mathi", "i");
  init (t, "mathpi", "pi");
  return t;
}
nat mmx_time ( )

Relative time of day.

Definition at line 25 of file timer.cpp.

            {
#ifdef BASIX_HAVE_GETTIMEOFDAY
  struct timeval tp;
  gettimeofday (&tp, NULL);
  return (nat) ((time_t) ((tp.tv_sec * 1000) + (tp.tv_usec / 1000)));
#else
  timeb tb;
  ftime (&tb);
  return (nat) ((time_t) ((tb.time * 1000) + tb.millitm));
#endif
}
string mmx::mmx_time_unit ( ) [inline]

Definition at line 27 of file timer.hpp.

{ return("ms"); };
size_t mmx_used_bytes ( )

Definition at line 159 of file fast_new.cpp.

References bytes_in_use.

                  {
  return bytes_in_use;
}
nat mmx_user_time ( )

User time of the current process and its terminated children.

Definition at line 51 of file timer.cpp.

                 {
#if defined(__MINGW__) || defined(__MINGW32__)
  return 0;
#else
  struct rusage used;
  nat t;
  getrusage(RUSAGE_SELF, &used);
  t = (nat) ((time_t) ((used.ru_utime.tv_sec * 1000)
                     + (used.ru_utime.tv_usec / 1000)));
  getrusage(RUSAGE_CHILDREN, &used);
  return t +  (nat) ((time_t) ((used.ru_utime.tv_sec * 1000)
                             + (used.ru_utime.tv_usec / 1000)));
#endif
}
string mmx::mmx_user_time_unit ( ) [inline]

Definition at line 31 of file timer.hpp.

{ return("ms"); };
double mmx_var_time ( )

Definition at line 38 of file timer.cpp.

                {
#ifdef BASIX_HAVE_GETTIMEOFDAY
  struct timeval tp;
  gettimeofday (&tp, NULL);
  return (((double) tp.tv_sec) * 1000) + ((double) (tp.tv_usec / 1000));
#else
  timeb tb;
  ftime (&tb);
  return (((double) tb.time) * 1000) + ((double) tb.millitm);
#endif
}
void mmx::mul ( R &  x,
const C1 &  y1,
const C2 &  y2 
) [inline]

Definition at line 56 of file operators.hpp.

Referenced by lmul_op::set_op(), rmul_op::set_op(), and mul_op::set_op().

{ x= y1 * y2; }
void mmx::mul_add ( R &  x,
const C1 &  y1,
const C2 &  y2 
) [inline]

Definition at line 60 of file operators.hpp.

Referenced by lmul_add_op::set_op(), rmul_add_op::set_op(), and mul_add_op::set_op().

{ x += y1 * y2; }
T mmx::mul_operator ( const T &  x,
const T &  y 
)

Definition at line 31 of file operators.hpp.

{ return x*y; }
void mmx::mul_sub ( R &  x,
const C1 &  y1,
const C2 &  y2 
) [inline]

Definition at line 62 of file operators.hpp.

Referenced by mul_sub_op::set_op().

{ x -= y1 * y2; }
generic multiplicative_error ( const generic x)
unary_return_type_helper<abs_op, C >::RET mmx::multiplicative_error ( const C &  x) [inline]

Definition at line 870 of file type_props.hpp.

References rounding_error().

                                                                          {
  return rounding_error (x); }
nat mmx::N ( const generic &  g) [inline]

Definition at line 156 of file generic.hpp.

                                {
  return g->get_length (); }
nat N ( const table< C, T, V > &  t) [inline]

Definition at line 219 of file table.hpp.

                   {
  return t->size;
}
nat N ( const heap< C > &  h) [inline]

Definition at line 193 of file heap.hpp.

                                  {
  return l.rep->n; }
nat N ( const chain< C > &  c) [inline]

Definition at line 135 of file chain.hpp.

Referenced by _mul_add(), inspector< compound >::access(), add_indentation(), add_modes(), append(), composed_routine_rep::apply(), identity_routine_rep::apply(), apply(), quintary_routine_rep< void, S1, S2, S3, S4, S5 >::apply(), quintary_routine_rep< D, S1, S2, S3, S4, S5 >::apply(), quaternary_routine_rep< void, S1, S2, S3, S4 >::apply(), quaternary_routine_rep< D, S1, S2, S3, S4 >::apply(), ternary_routine_rep< void, S1, S2, S3 >::apply(), ternary_routine_rep< D, S1, S2, S3 >::apply(), binary_routine_rep< void, S1, S2 >::apply(), binary_routine_rep< D, S1, S2 >::apply(), unary_routine_rep< void, S1 >::apply(), unary_routine_rep< D, S1 >::apply(), nullary_routine_rep< void >::apply(), as_charp(), as_cpp(), as_documents(), as_double(), as_generics(), as_int(), as_lisp(), as_math(), as_texmacs(), as_vector(), binary_helper< table< C, T, V > >::assemble(), binary_helper< sparse_vector< C, T, V > >::assemble(), binary_helper< list< C > >::assemble(), binary_helper< heap< C > >::assemble(), binary_helper< chain< C > >::assemble(), assign(), balance_left(), balance_right(), binary_map(), binary_map_optimized(), binary_map_scalar(), binary_test(), binary_test_scalar(), input_string_port_rep::busy(), composite_port_rep::busy(), posix_port_rep::busy(), input_output_string_port_rep::can_read(), input_string_port_rep::can_read(), composite_port_rep::can_read(), posix_port_rep::can_read(), composite_port_rep::can_write(), canonical_name(), cAr(), cDr(), cdr(), collect(), compare_numeric(), compare_sub(), composite_port_rep::component(), components(), compose(), composed_routine_rep::composed_routine_rep(), composite_port(), concat_append(), cons(), contains(), copy(), as_helper< vector< T, TV >, vector< F, FV > >::cv(), fast_helper< vector< C, V > >::dd(), decode_name(), destroy(), detach(), solve_vector_lde_op::diff_op(), binary_helper< chain< C > >::disassemble(), documentify(), dot(), ends(), composite_port_rep::error_flag(), composite_port_rep::error_message(), escape(), eval_system(), input_output_string_port_rep::expression(), input_string_port_rep::expression(), composite_port_rep::expression(), extend(), extract(), extract_mod(), socket_port_rep::feed(), find(), flatten(), composite_port_rep::flush(), formatting_port_rep::format(), get_directory(), get_extension(), get_file_source(), get_indentation(), get_interactive_number(), get_interactive_source(), GLUE_4(), GLUE_5(), hash(), identity_routine(), insert(), inside_append(), is_alpha(), is_applicable(), is_atom(), vector_iterator_rep< C, V >::is_busy(), heap_iterator_rep< C >::is_busy(), is_C0(), is_func(), composite_port_rep::is_input_port(), is_nil(), is_numeric(), composite_port_rep::is_output_port(), inspector< compound >::length(), list< cleaner >::list(), list_append_several(), list_apply(), list_map(), list_map_n(), locase(), locase_first(), make_document(), map(), message(), N(), nullary_set(), operator*(), operator<(), operator<<(), vector< C, V >::operator<<(), operator<=(), operator>(), operator>=(), vector< observer >::operator[](), ordered_product(), ordered_sum(), parse_instance::parse_instance(), parse_lisp(), path_name(), print_mmx(), range(), input_output_string_port_rep::read(), input_string_port_rep::read(), composite_port_rep::read(), posix_port_rep::read(), reads(), recompose(), relative_name(), remove(), REP_STRUCT_1(), REP_STRUCT_2(), replace(), replace_lf(), resolve_name(), reverse(), scheme_to_tm(), search_backwards(), search_forwards(), serialize(), signed_decompose(), size(), binary_helper< vector< C, V > >::size(), binary_helper< sparse_vector< C, T, V > >::size(), binary_helper< heap< C > >::size(), sort(), sort_leq(), source_exception(), source_locate(), starts(), store_interactive_number(), string_to_floating(), string_to_numeric(), strip_directory(), strip_extension(), texmacs_expand(), texmacs_to_scheme(), tokenize(), type_name(), un_try_catch(), unary_hash(), unary_map(), unary_set(), unary_set_scalar(), underlined(), unescape(), unquote(), upcase(), upcase_first(), updater_rep::update(), fast_helper< vector< C, V > >::uu(), var_load(), vector< observer >::vector(), vector_append_several(), vector_map(), vector_map_1(), vector_map_2(), vector_map_n(), vector_size(), composite_port_rep::wait(), WRAP_BINARY_IMPL_1(), WRAP_INDIRECT_IMPL(), composite_port_rep::write(), binary_helper< vector< C, V > >::write(), binary_helper< table< C, T, V > >::write(), binary_helper< sparse_vector< C, T, V > >::write(), binary_helper< string >::write(), write(), binary_helper< heap< C > >::write(), binary_helper< chain< C > >::write(), xgen_sub(), and dynamic_rep::~dynamic_rep().

{ return (c.rep == NULL? 0: c.rep->size); }
V nat N ( const vector< C, V > &  v) [inline]

Definition at line 202 of file vector.hpp.

{ return v->n; }
nat mmx::N ( const vector< C, vector_fixed< V, S > > &  v) [inline]

Definition at line 352 of file vector.hpp.

References val.

{ return S::val; }
nat mmx::N ( const list< C > &  l)

Return the number of elements in l.

Definition at line 155 of file list.hpp.

References cdr(), is_nil(), and N().

{ return is_nil (l)? 0: N (cdr (l)) + 1; }
V nat N ( const sparse_vector< C, T, V > &  v) [inline]

Definition at line 97 of file sparse_vector.hpp.

{ return v.rep->n; }
nat mmx::N ( const row_tuple< C > &  t) [inline]

Definition at line 43 of file row_tuple.hpp.

References N().

{ return N(*t)-1; }
C mmx::nan_cst ( ) [inline]

Definition at line 745 of file type_props.hpp.

References C, and set_nan().

{ C r; set_nan (r); return r; }
void mmx::neg ( R &  x) [inline]

Definition at line 48 of file operators.hpp.

Referenced by neg_op::set_op().

{ x= -x; }
void mmx::neg ( R &  x,
const C1 &  y1 
) [inline]

Definition at line 50 of file operators.hpp.

{ x= -y1; }
T mmx::neg_operator ( const T &  x)

Definition at line 28 of file operators.hpp.

{ return -x; }
alias<C> mmx::new_alias ( const C &  c) [inline]

Definition at line 55 of file alias.hpp.

{ return alias<C> (c); }
nat mmx::new_alias_type_id ( nat  id) [inline]

Definition at line 203 of file alias.hpp.

References alias_type_info().

Referenced by define_user_type().

                           {
  int mode= 2;
  alias_type_info (id, mode);
  return id;
}
generic_alias<C> mmx::new_genalias ( const alias< generic > &  a) [inline]

Definition at line 130 of file alias.hpp.

                                                                    {
  return generic_alias<C> (a); }
nat mmx::new_generic_alias_type_id ( nat  id) [inline]

Definition at line 210 of file alias.hpp.

References alias_type_info().

                                   {
  int mode= 3;
  alias_type_info (id, mode);
  return id;
}
nat mmx::new_tuple_type_id ( nat  id) [inline]

Definition at line 112 of file tuple.hpp.

References tuple_type_info().

                           {
  bool mode= true;
  tuple_type_info (id, mode);
  return id;
}
nat new_type_id ( )

Definition at line 31 of file generic.cpp.

References ASSERT.

Referenced by alias_type_info(), define_user_type(), global_type_id(), new_type_id(), and tuple_type_info().

               {
  static nat counter= 2;
  ASSERT (counter < 65000, "too many types");
  return counter++;
}
nat new_type_id ( const char *  s)

Definition at line 38 of file generic.cpp.

References contains(), inside_set(), new_type_id(), and s.

                            {
  static table<nat, string> t;
  if (!contains (t, s)) {
    nat id= new_type_id ();
    inside_set (t, s, id);
    return id;
  }
  return t[s];
}
generic next_above ( const generic x)

Definition at line 767 of file generic.cpp.

References current_ev, and GEN_NEXT_ABOVE.

                                      {
  return current_ev->apply (GEN_NEXT_ABOVE, x); }
double next_above ( const double &  x) [inline]

Definition at line 83 of file double.hpp.

Referenced by GLUE_39().

{ return nextafter (x, HUGE_VAL); }
double mmx::next_below ( const double &  x) [inline]

Definition at line 84 of file double.hpp.

Referenced by GLUE_40().

{ return nextafter (x, -HUGE_VAL); }
generic next_below ( const generic x)

Definition at line 769 of file generic.cpp.

References current_ev, and GEN_NEXT_BELOW.

                                      {
  return current_ev->apply (GEN_NEXT_BELOW, x); }
nat mmx::next_power_of_three ( nat  p) [inline]

Definition at line 73 of file int.hpp.

References n.

                            {
  // return 0 in case of overflow
  nat n= 1;
  while (n < p)
    n *= 3;
  return (n<p) ? 0 : n;
}
nat mmx::next_power_of_two ( nat  p) [inline]

Definition at line 47 of file int.hpp.

References n.

                          {
  // return 0 in case of overflow
  nat n= 1;
  while (n < p && n != 0)
    n = n << 1;
  return n;
}
void noop ( )

Definition at line 24 of file basix.cpp.

Referenced by loop_task_rep::execute().

{}
routine mmx::nullary_routine ( const generic name,
D(*)()  fun 
)

Definition at line 172 of file routine.hpp.

Referenced by define().

                                                   {
  return new nullary_routine_rep<D> (name, fun);
}
vector<C,V>& mmx::nullary_set ( vector< C, V > &  v)

Definition at line 796 of file vector.hpp.

References N(), n, and seg().

                             {
  typedef implementation<vector_linear,V> Vec;
  nat n= N(v);
  Vec::template vec_nullary<Op> (seg (v), n);
  return v;
}
generic numerator ( const generic x)

Definition at line 712 of file generic.cpp.

References current_ev, and GEN_NUMERATOR.

Referenced by numerator_op::Numerator_type(), numerator_op::op(), and numerator_op::set_op().

                                     {
  return current_ev->apply (GEN_NUMERATOR, x); }
syntactic numerator ( const syntactic x)

Definition at line 436 of file syntactic.cpp.

References GEN_NUMERATOR, and syn().

                                          {
  return syn (GEN_NUMERATOR, g1); }
string mmx::numeric_as_string ( const C &  x)

Definition at line 186 of file string.hpp.

References s.

                               {
  string s;
  numeric_to_string<C> (x, s);
  return s;
}
void mmx::numeric_to_string ( const C &  x,
string &  s 
)

Definition at line 150 of file string.hpp.

                                          {
  if (x == 0) s << '0';
  else if (x <= 0) { // NOTE x < 0 would be nicer, but yields warnings
    s << '-';
    numeric_to_string (-x, s);
  }
  else {
    if (x >= 10) numeric_to_string (x/10, s);
    s << (char) (((char) '0') + ((char) ((int) (x%10))));
  }
}
STMPL void numeric_to_string ( const float &  x,
string s 
)

Definition at line 209 of file string.cpp.

References floating_to_string().

                                                         {
  floating_to_string (x, s, "%1.8e"); }
STMPL void numeric_to_string ( const double &  x,
string s 
)

Definition at line 211 of file string.cpp.

References floating_to_string().

                                                          {
  floating_to_string (x, s, "%1.17le"); }
STMPL void numeric_to_string ( const long double &  x,
string s 
)

Definition at line 213 of file string.cpp.

References floating_to_string().

                                                               {
  floating_to_string (x, s, "%1.21Le"); }
static generic mmx::object_alias ( const generic x) [static]

Definition at line 83 of file generic_object.cpp.

References as_object(), scalar_to_alias(), and type().

Referenced by define_user_type().

                                               {
  nat alias_id= scalar_to_alias (type (x));
  return as_object (as<generic> (new_alias<generic> (x)), alias_id); }
static bool mmx::object_equal ( const generic x,
const generic y 
) [static]

Definition at line 74 of file generic_object.cpp.

Referenced by define_user_type().

                                                              {
  return x == y; }
static syntactic mmx::object_flatten ( const generic x) [static]

Definition at line 78 of file generic_object.cpp.

References apply(), as_generic(), flatten(), type(), and type_name().

Referenced by define_user_type().

                                                   {
  nat id= type (x);
  generic rep= as_generic (x, id);
  return apply ("object", flatten (rep), flatten (type_name (id))); }
static alias<generic> mmx::object_generalize_alias ( const generic x) [static]

Definition at line 95 of file generic_object.cpp.

References as_generic(), and type().

Referenced by define_user_type().

                                                                 {
  nat alias_id= type (x);
  return as<alias<generic> > (as_generic (x, alias_id)); }
static generic mmx::object_get_alias ( const generic x) [static]

Definition at line 86 of file generic_object.cpp.

References as(), as_generic(), get_alias(), and type().

Referenced by define_user_type().

                                                   {
  nat alias_id= type (x);
  return get_alias (as<alias<generic> > (as_generic (x, alias_id))); }
static generic mmx::object_set_alias ( const generic x,
const generic y 
) [static]

Definition at line 89 of file generic_object.cpp.

References as(), as_generic(), set_alias(), and type().

Referenced by define_user_type().

                                                                     {
  nat alias_id= type (x);
  return set_alias (as<alias<generic> > (as_generic (x, alias_id)), y); }
static generic mmx::object_specialize_alias ( const alias< generic > &  x) [static]

Definition at line 92 of file generic_object.cpp.

References as_object(), get_alias(), scalar_to_alias(), and type().

Referenced by define_user_type().

                                                                 {
  nat alias_id= scalar_to_alias (type (get_alias (x)));
  return as_object (as<generic> (x), alias_id); }
static bool mmx::object_unequal ( const generic x,
const generic y 
) [static]

Definition at line 76 of file generic_object.cpp.

Referenced by define_user_type().

                                                                {
  return x != y; }
C& mmx::open_alias ( const alias< C > &  a) [inline]

Definition at line 57 of file alias.hpp.

Referenced by alias_binary_access_rep< C, R, A, B >::open(), and alias_unary_access_rep< C, R, A >::open().

{ return a->open (); }
generic mmx::operate ( const generic g,
const generic h 
) [inline]

Definition at line 139 of file mmx_printer.cpp.

References gen().

Referenced by mmx_printer::pp_E0().

                                                            {
  return gen ("$operate", g, h); }
bool operator!= ( const generic x1,
const int &  x2 
)

Definition at line 580 of file generic.cpp.

{ return !(x1 == x2); }
bool operator!= ( const symbol< C, V > &  s1,
const symbol< C, V > &  s2 
) [inline]

Definition at line 103 of file symbol.hpp.

                                                                  {
  return (*s1) != (*s2); }
bool mmx::operator!= ( const document c1,
const document c2 
) [inline]

Definition at line 53 of file document.hpp.

                                                                 {
  return (*c1) != (*c2); }
bool operator!= ( const generic x1,
const generic x2 
)

Definition at line 579 of file generic.cpp.

{ return !(x1 == x2); }
bool mmx::operator!= ( const symbol< C, equal_table > &  s1,
const symbol< C, equal_table > &  s2 
) [inline]

Definition at line 120 of file symbol.hpp.

References exact_neq().

                                              {
  return exact_neq (s1, s2); }
bool mmx::operator!= ( const exception &  e1,
const exception &  e2 
) [inline]

Definition at line 41 of file exception.hpp.

                                                                   {
  return (*e1) != (*e2); }
bool mmx::operator!= ( const syntactic &  c1,
const syntactic &  c2 
) [inline]

Definition at line 56 of file syntactic.hpp.

                                                                   {
  return (*c1) != (*c2); }
bool mmx::operator!= ( const literal c1,
const literal c2 
) [inline]

Definition at line 46 of file literal.hpp.

                                                               {
  return as_symbol (c1) != as_symbol (c2); }
bool mmx::operator!= ( const compound c1,
const compound c2 
) [inline]

Definition at line 49 of file compound.hpp.

                                                                 {
  return as_symbol (c1) != as_symbol (c2); }
bool operator!= ( const int &  x1,
const generic x2 
)

Definition at line 582 of file generic.cpp.

{ return x2 != x1; }
generic operator& ( const generic x1,
const generic x2 
)

Definition at line 839 of file generic.cpp.

References current_ev, and GEN_AND.

                                                          {
  return current_ev->apply (GEN_AND, x1, x2); }
table<C,T,V> mmx::operator& ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 629 of file table.hpp.

                                                              {
  return binary_map<and_op,C,T,V> (t, u); }
vector<C,V> mmx::operator& ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1035 of file vector.hpp.

                                                          {
  return binary_map<and_op> (v, w); }
table<C,T,V> mmx::operator&= ( table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 663 of file table.hpp.

                                                         {
  return unary_set<and_op,C,T,V> (t, u); }
string mmx::operator* ( const string s1,
const string s2 
)

Definition at line 382 of file string.cpp.

References N().

                                                {
  register nat i, n1=N(s1), n2=N(s2);
  string r (n1 + n2);
  for (i=0; i<n1; i++) r.rep->a[i   ]= s1.rep->a[i];
  for (i=0; i<n2; i++) r.rep->a[i+n1]= s2.rep->a[i];
  return r;
}
generic operator* ( const generic x1,
const generic x2 
)

Definition at line 393 of file generic.cpp.

References ACC_BINARY, ACC_MUL, current_ev, and GEN_TIMES.

                                                  {
  ACC_BINARY (ACC_MUL, x1, x2);
  return current_ev->apply (GEN_TIMES, x1, x2);
}
generic operator* ( const generic x1,
const int &  x2 
)

Definition at line 408 of file generic.cpp.

                                                      {
  return x1 * generic (x2); }
syntactic operator* ( const syntactic g1,
const syntactic g2 
)

Definition at line 251 of file syntactic.cpp.

References exact_eq(), frac_flag, GEN_OVER, GEN_TIMES, is_func(), and syn().

                                                      {
  if (frac_flag && is_func (g1, GEN_OVER, 2)) {
    if (is_func (g2, GEN_OVER, 2))
      return syn (GEN_OVER, g1[1] * g2[1], g1[2] * g2[2]);
    else return syn (GEN_OVER, g1[1] * g2, g1[2]);
  }
  if (frac_flag && is_func (g2, GEN_OVER, 2))
    return syn (GEN_OVER, g1 * g2[1], g2[2]);
  if (exact_eq (g1, 0)) return 0;
  if (exact_eq (g2, 0)) return 0;
  if (exact_eq (g1, 1)) return g2;
  if (exact_eq (g2, 1)) return g1;
  if (exact_eq (g1, -1)) return -g2;
  if (exact_eq (g2, -1)) return -g1;
  return syn (GEN_TIMES, g1, g2);
}
table<C,T,V> mmx::operator* ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 619 of file table.hpp.

                                                              {
  return binary_map<mul_op,C,T,V> (t, u); }
table<C,T,V> mmx::operator* ( const table< C, T, V > &  t,
const K &  sc 
) [inline]

Definition at line 636 of file table.hpp.

                                         {
  return binary_map_scalar<rmul_op> (t, sc); }
table<C,T,V> mmx::operator* ( const K &  sc,
const table< C, T, V > &  t 
) [inline]

Definition at line 639 of file table.hpp.

                                         {
  return binary_map_scalar<lmul_op> (t, sc); }
generic operator* ( const int &  x1,
const generic x2 
)

Definition at line 416 of file generic.cpp.

                                                      {
  return generic (x1) * x2; }
chain< C > operator* ( const chain< C > &  l,
const chain< C > &  r 
)

Definition at line 318 of file chain.hpp.

References balance_left(), balance_right(), cAr(), car(), cDr(), cdr(), Chain, left(), middle(), N(), and right().

                                            {
  nat nl= N (l), nr= N (r);
  if (nl < nr) {
    if (nl == 0) return r;
    if (nr < 2*nl + 3) return Chain (l, car (r), cdr (r));
    Chain br= balance_right (r);
    return Chain (l * left (br), middle (br), right (br));
  }
  else {
    if (nr == 0) return l;
    if (nl < 2*nr + 3) return Chain (cDr (l), cAr (l), r);
    Chain bl= balance_left (l);
    return Chain (left (bl), middle (bl), right (bl) * r);
  }
}
vector<C,V> mmx::operator* ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1001 of file vector.hpp.

                                                          {
  return binary_map<mul_op> (v, w); }
vector<C,V> mmx::operator* ( const vector< C, V > &  v,
const C &  c 
)

Definition at line 1009 of file vector.hpp.

                                                     {
  return binary_map_scalar<rmul_op> (v, c); }
iterator<C> mmx::operator* ( const iterator< C > &  it1,
const iterator< C > &  it2 
)

Definition at line 381 of file iterator.hpp.

References Iterator.

                                                      {
  return Iterator (new join_iterator_rep<C> (it1, it2));
}
sparse_vector<C,T,V> mmx::operator* ( const sparse_vector< C, T, V > &  t,
const C &  sc 
) [inline]

Definition at line 291 of file sparse_vector.hpp.

                                                 {
  return binary_map_scalar<rmul_op> (t, sc); }
sparse_vector<C,T,V> mmx::operator* ( const C &  sc,
const sparse_vector< C, T, V > &  t 
) [inline]

Definition at line 294 of file sparse_vector.hpp.

                                                 {
  return binary_map_scalar<lmul_op> (t, sc); }
sparse_vector<C,T,V> mmx::operator* ( const sparse_vector< C, T, V > &  t,
const sparse_vector< C, T, V > &  u 
) [inline]

Definition at line 264 of file sparse_vector.hpp.

                                                            {
  return binary_map<mul_op,C,T,V> (t, u); }
pair<C1,C2> C2 pair<C1,C2> mmx::operator* ( const pair< C1, C2 > &  p1,
const pair< C1, C2 > &  p2 
) [inline]

Definition at line 58 of file pair.hpp.

References Pair.

                                            {
  return Pair (p1.x1 * p2.x1, p1.x2 * p2.x2);
}
vector<C,V> mmx::operator* ( const C &  c,
const vector< C, V > &  v 
)

Definition at line 1014 of file vector.hpp.

                                                     {
  return binary_map_scalar<lmul_op> (v, c); }
list<C> mmx::operator* ( const list< C > &  l1,
const list< C > &  l2 
) [inline]

Definition at line 288 of file list.hpp.

References append().

                                            {
  return append (l1, l2);
}
vector<int,V> mmx::operator* ( const int &  c,
const vector< int, V > &  v 
)

Definition at line 1017 of file vector.hpp.

                                               {
  return binary_map_scalar<lmul_op> (v, c); }
vector<int,V> mmx::operator* ( const vector< int, V > &  v,
const int &  c 
)

Definition at line 1012 of file vector.hpp.

                                               {
  return binary_map_scalar<rmul_op> (v, c); }
table<C,T,V>& mmx::operator*= ( table< C, T, V > &  t,
const K &  sc 
) [inline]

Definition at line 666 of file table.hpp.

                                    {
  return unary_set_scalar<rmul_op> (t, sc); }
table<C,T,V> mmx::operator*= ( table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 657 of file table.hpp.

                                                         {
  return unary_set<mul_op,C,T,V> (t, u); }
C& mmx::operator*= ( C &  x,
const D &  y 
) [inline]

Definition at line 334 of file defaults.hpp.

{ return x= x*y; }
vector<C,V>& mmx::operator*= ( vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1042 of file vector.hpp.

                                                      {
  return unary_set<mul_op> (v, w); }
vector<C,V>& mmx::operator*= ( vector< C, V > &  v,
const C &  c 
)

Definition at line 1046 of file vector.hpp.

                                                 {
  return unary_set_scalar<rmul_op> (v, c); }
table<C,T,V> mmx::operator+ ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 607 of file table.hpp.

                                                              {
  return binary_map<add_op,C,T,V> (t, u); }
generic operator+ ( const generic x1,
const int &  x2 
)

Definition at line 404 of file generic.cpp.

                                                      {
  return x1 + generic (x2); }
table<C,T,V> mmx::operator+ ( const table< C, T, V > &  t,
const C &  u 
) [inline]

Definition at line 609 of file table.hpp.

References Table.

                                                          {
  return binary_map<add_op,C,T,V> (t, Table (u)); }
vector<C,V> mmx::operator+ ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 977 of file vector.hpp.

                                                          {
  return binary_map<add_op> (v, w); }
vector<C,V> mmx::operator+ ( const C &  v,
const vector< C, V > &  w 
)

Definition at line 979 of file vector.hpp.

References Vector.

                                                     {
  return binary_map<add_op> (Vector (v), w); }
generic operator+ ( const generic x1,
const generic x2 
)

Definition at line 381 of file generic.cpp.

References ACC_ADD, ACC_BINARY, current_ev, and GEN_PLUS.

                                                  {
  ACC_BINARY (ACC_ADD, x1, x2);
  return current_ev->apply (GEN_PLUS, x1, x2);
}
table<C,T,V> mmx::operator+ ( const C &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 611 of file table.hpp.

References Table.

                                                          {
  return binary_map<add_op,C,T,V> (Table (t), u); }
syntactic operator+ ( const syntactic g1,
const syntactic g2 
)

Definition at line 168 of file syntactic.cpp.

References exact_eq(), GEN_MINUS, GEN_PLUS, is_func(), signed_decompose(), and syn().

                                                      {
  if (exact_eq (g1, 0)) return g2;
  if (exact_eq (g2, 0)) return g1;
  if (is_func (g2, GEN_MINUS, 1))
    return g1 - g2[1];
  if (is_func (g2, GEN_PLUS, 2))
    return (g1 + g2[1]) + g2[2];
  if (is_func (g2, GEN_MINUS, 2))
    return (g1 + g2[1]) - g2[2];
  syntactic abs_g2; int sgn_g2;
  signed_decompose (g2, abs_g2, sgn_g2);
  if (sgn_g2 < 0) return syn (GEN_MINUS, g1, abs_g2);
  else return syn (GEN_PLUS, g1, abs_g2);
}
generic operator+ ( const int &  x1,
const generic x2 
)

Definition at line 412 of file generic.cpp.

                                                      {
  return generic (x1) + x2; }
vector<int,V> mmx::operator+ ( const vector< int, V > &  w,
const int &  v 
)

Definition at line 987 of file vector.hpp.

References Vector_int.

                                               {
  return binary_map<add_op> (w, Vector_int (v)); }
vector<int,V> mmx::operator+ ( const int &  v,
const vector< int, V > &  w 
)

Definition at line 982 of file vector.hpp.

References Vector_int.

                                               {
  return binary_map<add_op> (Vector_int (v), w); }
vector<C,V> mmx::operator+ ( const vector< C, V > &  w,
const C &  v 
)

Definition at line 984 of file vector.hpp.

References Vector.

                                                     {
  return binary_map<add_op> (w, Vector (v)); }
sparse_vector<C,T,V> mmx::operator+ ( const sparse_vector< C, T, V > &  t,
const sparse_vector< C, T, V > &  u 
) [inline]

Definition at line 258 of file sparse_vector.hpp.

                                                            {
  return binary_map_optimized<add_op,C,T,V> (t, u); }
table<C,T,V> mmx::operator+= ( table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 653 of file table.hpp.

                                                         {
  return unary_set<add_op,C,T,V> (t, u); }
C& mmx::operator+= ( C &  x,
const D &  y 
) [inline]

Definition at line 330 of file defaults.hpp.

{ return x= x+y; }
vector<C,V>& mmx::operator+= ( vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1038 of file vector.hpp.

                                                      {
  return unary_set<add_op> (v, w); }
syntactic operator- ( const syntactic g1,
const syntactic g2 
)

Definition at line 184 of file syntactic.cpp.

References exact_eq(), GEN_MINUS, GEN_PLUS, is_func(), signed_decompose(), and syn().

                                                      {
  if (exact_eq (g2, 0)) return g1;
  if (is_func (g2, GEN_MINUS, 1))
    return g1 + g2[1];
  if (is_func (g2, GEN_PLUS, 2))
    return (g1 - g2[1]) - g2[2];
  if (is_func (g2, GEN_MINUS, 2))
    return (g1 - g2[1]) + g2[2];
  syntactic abs_g2; int sgn_g2;
  signed_decompose (g2, abs_g2, sgn_g2);
  if (exact_eq (g1, 0)) {
    if (sgn_g2 > 0) return syn (GEN_MINUS, abs_g2);
    else return abs_g2;    
  }
  else {
    if (sgn_g2 > 0) return syn (GEN_MINUS, g1, abs_g2);
    else return syn (GEN_PLUS, g1, abs_g2);
  }
}
generic operator- ( const generic x1)

Definition at line 363 of file generic.cpp.

References ACC_NEGATE, ACC_UNARY, current_ev, and GEN_MINUS.

                               {
  ACC_UNARY (ACC_NEGATE, x1);
  return current_ev->apply (GEN_MINUS, x1);
}
syntactic operator- ( const syntactic g)

Definition at line 153 of file syntactic.cpp.

References exact_eq(), GEN_MINUS, GEN_PLUS, is_func(), signed_decompose(), and syn().

                                {
  if (exact_eq (g, 0)) return g;
  if (is_func (g, GEN_MINUS, 1))
    return g[1];
  if (is_func (g, GEN_PLUS, 2))
    return (-g[1]) - g[2];
  if (is_func (g, GEN_MINUS, 2))
    return (-g[1]) + g[2];
  syntactic abs_g; int sgn_g;
  signed_decompose (g, abs_g, sgn_g);
  if (sgn_g > 0) return syn (GEN_MINUS, abs_g);
  else return abs_g;
}
table<C,T,V> mmx::operator- ( const table< C, T, V > &  t,
const C &  u 
) [inline]

Definition at line 615 of file table.hpp.

References Table.

                                                          {
  return binary_map<sub_op,C,T,V> (t, Table (u)); }
generic operator- ( const generic x1,
const generic x2 
)

Definition at line 387 of file generic.cpp.

References ACC_BINARY, ACC_SUB, current_ev, and GEN_MINUS.

                                                  {
  ACC_BINARY (ACC_SUB, x1, x2);
  return current_ev->apply (GEN_MINUS, x1, x2);
}
table<C,T,V> mmx::operator- ( const table< C, T, V > &  t) [inline]

Definition at line 605 of file table.hpp.

                                              {
  return unary_map<neg_op,C,T,V> (t); }
generic operator- ( const int &  x1,
const generic x2 
)

Definition at line 414 of file generic.cpp.

                                                      {
  return generic (x1) - x2; }
sparse_vector<C,T,V> mmx::operator- ( const sparse_vector< C, T, V > &  t) [inline]

Definition at line 187 of file sparse_vector.hpp.

                                    {
  return unary_map<neg_op,C,T,V> (t); }
table<C,T,V> mmx::operator- ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 613 of file table.hpp.

                                                              {
  return binary_map<sub_op,C,T,V> (t, u); }
table<C,T,V> mmx::operator- ( const C &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 617 of file table.hpp.

References Table.

                                                          {
  return binary_map<sub_op,C,T,V> (Table (t), u); }
vector<C,V> mmx::operator- ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 989 of file vector.hpp.

                                                          {
  return binary_map<sub_op> (v, w); }
vector<int,V> mmx::operator- ( const int &  v,
const vector< int, V > &  w 
)

Definition at line 999 of file vector.hpp.

References Vector_int.

                                               {
  return binary_map<sub_op> (Vector_int (v), w); }
vector<int,V> mmx::operator- ( const vector< int, V > &  v,
const int &  w 
)

Definition at line 994 of file vector.hpp.

References Vector_int.

                                               {
  return binary_map<sub_op> (v, Vector_int (w)); }
vector<C,V> mmx::operator- ( const vector< C, V > &  v)

Definition at line 975 of file vector.hpp.

                                         {
  return unary_map<neg_op> (v); }
vector<C,V> mmx::operator- ( const C &  v,
const vector< C, V > &  w 
)

Definition at line 996 of file vector.hpp.

References Vector.

                                                     {
  return binary_map<sub_op> (Vector (v), w); }
vector<C,V> mmx::operator- ( const vector< C, V > &  v,
const C &  w 
)

Definition at line 991 of file vector.hpp.

References Vector.

                                                     {
  return binary_map<sub_op> (v, Vector (w)); }
generic operator- ( const generic x1,
const int &  x2 
)

Definition at line 406 of file generic.cpp.

                                                      {
  return x1 - generic (x2); }
sparse_vector<C,T,V> mmx::operator- ( const sparse_vector< C, T, V > &  t,
const sparse_vector< C, T, V > &  u 
) [inline]

Definition at line 261 of file sparse_vector.hpp.

                                                            {
  return binary_map_optimized<sub_op,C,T,V> (t, u); }
table<C,T,V> mmx::operator-= ( table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 655 of file table.hpp.

                                                         {
  return unary_set<sub_op,C,T,V> (t, u); }
vector<C,V>& mmx::operator-= ( vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1040 of file vector.hpp.

                                                      {
  return unary_set<sub_op> (v, w); }
C& mmx::operator-= ( C &  x,
const D &  y 
) [inline]

Definition at line 332 of file defaults.hpp.

{ return x= x-y; }
generic operator/ ( const generic x1,
const int &  x2 
)

Definition at line 410 of file generic.cpp.

                                                      {
  return x1 / generic (x2); }
table<C,T,V> mmx::operator/ ( const table< C, T, V > &  t,
const K &  sc 
) [inline]

Definition at line 642 of file table.hpp.

                                         {
  return binary_map_scalar<rdiv_op> (t, sc); }
generic operator/ ( const int &  x1,
const generic x2 
)

Definition at line 418 of file generic.cpp.

                                                      {
  return generic (x1) / x2; }
sparse_vector<C,T,V> mmx::operator/ ( const sparse_vector< C, T, V > &  t,
const C &  sc 
) [inline]

Definition at line 297 of file sparse_vector.hpp.

                                                 {
  return binary_map_scalar<rdiv_op> (t, sc); }
table<C,T,V> mmx::operator/ ( const K &  sc,
const table< C, T, V > &  t 
) [inline]

Definition at line 645 of file table.hpp.

                                         {
  return binary_map_scalar<ldiv_op> (t, sc); }
table<C,T,V> mmx::operator/ ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 621 of file table.hpp.

                                                              {
  return binary_map<div_op,C,T,V> (t, u); }
vector<int,V> mmx::operator/ ( const vector< int, V > &  v,
const int &  c 
)

Definition at line 1022 of file vector.hpp.

                                               {
  return binary_map_scalar<rdiv_op> (v, c); }
vector<int,V> mmx::operator/ ( const int &  c,
const vector< int, V > &  v 
)

Definition at line 1027 of file vector.hpp.

                                               {
  return binary_map_scalar<ldiv_op> (v, c); }
sparse_vector<C,T,V> mmx::operator/ ( const C &  sc,
const sparse_vector< C, T, V > &  t 
) [inline]

Definition at line 300 of file sparse_vector.hpp.

                                                 {
  return binary_map_scalar<ldiv_op> (t, sc); }
syntactic operator/ ( const syntactic g1,
const syntactic g2 
)

Definition at line 269 of file syntactic.cpp.

References exact_eq(), frac_flag, GEN_OVER, is_func(), and syn().

                                                      {
  if (frac_flag && is_func (g2, GEN_OVER, 2))
    return g1 * syn (GEN_OVER, g2[2], g2[1]);
  if (exact_eq (g2, 1)) return g1;
  if (exact_eq (g2, -1)) return -g1;
  if (frac_flag) return g1 * syn (GEN_OVER, 1, g2);
  else return syn (GEN_OVER, g1, g2);
}
generic operator/ ( const generic x1,
const generic x2 
)

Definition at line 399 of file generic.cpp.

References ACC_BINARY, ACC_DIV, current_ev, and GEN_OVER.

                                                  {
  ACC_BINARY (ACC_DIV, x1, x2);
  return current_ev->apply (GEN_OVER, x1, x2);
}
vector<C,V> mmx::operator/ ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1003 of file vector.hpp.

                                                          {
  return binary_map<div_op> (v, w); }
vector<C,V> mmx::operator/ ( const vector< C, V > &  v,
const C &  c 
)

Definition at line 1019 of file vector.hpp.

                                                     {
  return binary_map_scalar<rdiv_op> (v, c); }
vector<C,V> mmx::operator/ ( const C &  c,
const vector< C, V > &  v 
)

Definition at line 1024 of file vector.hpp.

                                                     {
  return binary_map_scalar<ldiv_op> (v, c); }
vector<C,V>& mmx::operator/= ( vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1044 of file vector.hpp.

                                                      {
  return unary_set<div_op> (v, w); }
table<C,T,V> mmx::operator/= ( table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 659 of file table.hpp.

                                                         {
  return unary_set<div_op,C,T,V> (t, u); }
table<C,T,V>& mmx::operator/= ( table< C, T, V > &  t,
const K &  sc 
) [inline]

Definition at line 669 of file table.hpp.

                                    {
  return unary_set_scalar<rdiv_op> (t, sc); }
C& mmx::operator/= ( C &  x,
const D &  y 
) [inline]

Definition at line 336 of file defaults.hpp.

{ return x= x/y; }
vector<C,V>& mmx::operator/= ( vector< C, V > &  v,
const C &  c 
)

Definition at line 1048 of file vector.hpp.

                                                 {
  return unary_set_scalar<rdiv_op> (v, c); }
bool operator< ( const string s,
const string t 
)

Definition at line 267 of file string.cpp.

References N().

                                                {
  register nat i;
  for (i=0; i<N(s1); i++) {
    if (i >= N(s2)) return false;
    if (s1[i] < s2[i]) return true;
    if (s2[i] < s1[i]) return false;
  }
  return false;
}
bool operator< ( const generic x1,
const generic x2 
)

Definition at line 624 of file generic.cpp.

References ACC_LESS, ACC_TEST, as_bool(), current_ev, and GEN_LESS.

                                                  {
  ACC_TEST (ACC_LESS, x1, x2);
  return as_bool (current_ev->apply (GEN_LESS, x1, x2));
}
bool operator< ( const generic x1,
const int &  x2 
)

Definition at line 647 of file generic.cpp.

                                                   {
  return x1 < generic (x2); }
bool operator< ( const int &  x1,
const generic x2 
)

Definition at line 655 of file generic.cpp.

                                                   {
  return generic (x1) < x2; }
port mmx::operator<< ( const port &  out,
const print_format &  fm 
) [inline]

Definition at line 161 of file port.hpp.

References inside().

                                                      {
  inside (out) -> format (fm);
  return out;
}
port mmx::operator<< ( const port &  out,
const charp &  s 
) [inline]

Definition at line 143 of file port.hpp.

References string_as_mmx(), and write().

                                              {
  write (out, string_as_mmx (s));
  return out;
}
port mmx::operator<< ( const port &  out,
const const_charp &  s 
) [inline]

Definition at line 149 of file port.hpp.

References string_as_mmx(), and write().

                                                    {
  write (out, string_as_mmx (s));
  return out;
}
generic operator<< ( const generic x1,
const generic x2 
)

Definition at line 792 of file generic.cpp.

References current_ev, and GEN_LESSLESS.

                                                           {
  return current_ev->apply (GEN_LESSLESS, x1, x2); }
port mmx::operator<< ( const port &  out,
const char &  c 
) [inline]

Definition at line 155 of file port.hpp.

References string_as_mmx(), and write().

                                             {
  write (out, string_as_mmx (c));
  return out;
}
syntactic operator<< ( const syntactic x1,
const syntactic x2 
)

Definition at line 441 of file syntactic.cpp.

References GEN_LESSLESS, and syn().

                                                                 {
  return syn (GEN_LESSLESS, x1, x2); }
heap<C>& mmx::operator<< ( heap< C > &  h,
const C &  x 
) [inline]

Definition at line 196 of file heap.hpp.

References push().

                                                    {
  push (h, x); return h; }
port mmx::operator<< ( const port &  out,
const string &  s 
) [inline]

Definition at line 137 of file port.hpp.

References string_as_mmx(), and write().

                                               {
  write (out, string_as_mmx (s));
  return out;
}
static string& mmx::operator<< ( string out,
const char *  s 
) [static]

Definition at line 213 of file cpp_printer.cpp.

                                         {
  return out << string (s);
}
port operator<< ( const port &  out,
const C &  x 
) [inline]

Definition at line 131 of file port.hpp.

References output_as_mmx(), and write().

                                          {
  write (out, output_as_mmx (as<generic> (x)));
  return out;
}
static string& mmx::operator<< ( string out,
print_controls  pc 
) [static]

Definition at line 193 of file cpp_printer.cpp.

References INDENT, indentation_level, inside(), LF, N(), and UNINDENT.

                                             {
  switch (pc) {
  case LF:
    out << "\n";
    for (nat i=0; i<indentation_level; i++) out << "  ";
    break;
  case INDENT:
    indentation_level++;
    out << "  ";
    break;
  case UNINDENT:
    indentation_level--;
    if (N(out) >= 2 && out[N(out)-2] == ' ' && out[N(out)-1] == ' ')
      inside (out) -> resize (N(out) - 2);
    break;
  }
  return out;
}
static string& mmx::operator<< ( string out,
const generic g 
) [static]

Definition at line 218 of file cpp_printer.cpp.

References mmerr, and type_name().

                                            {
  if (is<string> (g)) return out << as<string> (g);
  if (is<literal> (g)) return out << (*(as<literal> (g)));
  mmerr << g << ": " << type_name (g) << "\n";
  assert (false);
  return out;
}
bool operator<= ( const generic x1,
const generic x2 
)

Definition at line 630 of file generic.cpp.

References ACC_LESSEQ, ACC_TEST, as_bool(), current_ev, and GEN_LESSEQ.

                                                   {
  ACC_TEST (ACC_LESSEQ, x1, x2);
  return as_bool (current_ev->apply (GEN_LESSEQ, x1, x2));
}
bool mmx::operator<= ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 671 of file table.hpp.

                                                              {
  return binary_test<lesseq_op> (t, u); }
bool mmx::operator<= ( const table< C, T, V > &  t,
const K &  c 
) [inline]

Definition at line 679 of file table.hpp.

                                         {
  return binary_test_scalar<lesseq_op> (t, c); }
bool mmx::operator<= ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1055 of file vector.hpp.

                                                         {
  return binary_test<lesseq_op> (v, w); }
bool mmx::operator<= ( const vector< C, V > &  v,
const C &  c 
)

Definition at line 1064 of file vector.hpp.

                                                    {
  return binary_test_scalar<lesseq_op> (v, c); }
bool mmx::operator<= ( const vector< int, V > &  v,
const int &  c 
)

Definition at line 1067 of file vector.hpp.

                                                {
  return binary_test_scalar<lesseq_op> (v, c); }
bool operator<= ( const generic x1,
const int &  x2 
)

Definition at line 649 of file generic.cpp.

                                                    {
  return x1 <= generic (x2); }
bool operator<= ( const int &  x1,
const generic x2 
)

Definition at line 657 of file generic.cpp.

                                                    {
  return generic (x1) <= x2; }
bool operator<= ( const string s,
const string t 
)

Definition at line 278 of file string.cpp.

References N().

                                                 {
  register nat i;
  for (i=0; i<N(s1); i++) {
    if (i >= N(s2)) return false;
    if (s1[i] < s2[i]) return true;
    if (s2[i] < s1[i]) return false;
  }
  return true;
}
bool mmx::operator== ( const vector< int, V > &  v,
const int &  c 
)

Definition at line 1062 of file vector.hpp.

                                                {
  return binary_test_scalar<equal_op> (v, c); }
bool operator== ( const symbol< C, V > &  s1,
const symbol< C, V > &  s2 
) [inline]

Definition at line 101 of file symbol.hpp.

                                                                  {
  return (*s1) == (*s2); }
bool operator== ( const int &  x1,
const generic x2 
)

Definition at line 581 of file generic.cpp.

{ return x2 == x1; }
bool mmx::operator== ( const table< C, T, V > &  t,
const K &  c 
) [inline]

Definition at line 676 of file table.hpp.

                                         {
  return binary_test_scalar<equal_op> (t, c); }
bool mmx::operator== ( const document c1,
const document c2 
) [inline]

Definition at line 51 of file document.hpp.

                                                                 {
  return (*c1) == (*c2); }
bool operator== ( const generic x1,
const generic x2 
)

Definition at line 554 of file generic.cpp.

References as_bool(), current_ev, GEN_EQUAL, is_nil(), and same_type().

                                                   {
  if (same_type (x1, x2))
    return x1->is_equal (x2);
  else {
    routine* cv= x1->acc_construct (x2->acc_id ());
    if (cv != NULL && !is_nil (*cv))
      return x1 -> is_equal ((*cv) (x2));
    cv= x2->acc_construct (x1->acc_id ());
    if (cv != NULL && !is_nil (*cv))
      return (*cv) (x1) -> is_equal (x2);
  }
  return as_bool (current_ev->apply (GEN_EQUAL, x1, x2));
}
bool mmx::operator== ( const table< C, T, V > &  t1,
const table< C, T, V > &  t2 
)
bool mmx::operator== ( const syntactic &  c1,
const syntactic &  c2 
) [inline]

Definition at line 54 of file syntactic.hpp.

                                                                   {
  return (*c1) == (*c2); }
bool mmx::operator== ( const vector< C, V > &  v,
const C &  c 
)

Definition at line 1059 of file vector.hpp.

                                                    {
  return binary_test_scalar<equal_op> (v, c); }
bool mmx::operator== ( const literal c1,
const literal c2 
) [inline]

Definition at line 44 of file literal.hpp.

                                                               {
  return as_symbol (c1) == as_symbol (c2); }
bool operator== ( const generic x1,
const int &  x2 
)

Definition at line 569 of file generic.cpp.

References is_nil().

                                               {
  if (is<int> (x1)) return as<int> (x1) == x2;
  else {
    routine* cv= x1->acc_construct (accelerator<int>::id);
    if (cv != NULL && !is_nil (*cv))
      return x1 -> is_equal ((*cv) (as<generic> (x2)));
  }
  return x1 == generic (x2);
}
bool mmx::operator== ( const exception &  e1,
const exception &  e2 
) [inline]

Definition at line 39 of file exception.hpp.

                                                                   {
  return (*e1) == (*e2); }
bool mmx::operator== ( const symbol< C, equal_table > &  s1,
const symbol< C, equal_table > &  s2 
) [inline]

Definition at line 116 of file symbol.hpp.

References exact_eq().

                                              {
  return exact_eq (s1, s2); }
bool mmx::operator== ( const compound c1,
const compound c2 
) [inline]

Definition at line 47 of file compound.hpp.

                                                                 {
  return as_symbol (c1) == as_symbol (c2); }
bool operator> ( const string s,
const string t 
)

Definition at line 289 of file string.cpp.

References N().

                                                {
  register nat i;
  for (i=0; i<N(s1); i++) {
    if (i >= N(s2)) return true;
    if (s1[i] > s2[i]) return true;
    if (s2[i] > s1[i]) return false;
  }
  return false;
}
bool operator> ( const generic x1,
const int &  x2 
)

Definition at line 651 of file generic.cpp.

                                                   {
  return x1 > generic (x2); }
bool operator> ( const generic x1,
const generic x2 
)

Definition at line 636 of file generic.cpp.

References ACC_GTR, ACC_TEST, as_bool(), current_ev, and GEN_GTR.

                                                  {
  ACC_TEST (ACC_GTR, x1, x2);
  return as_bool (current_ev->apply (GEN_GTR, x1, x2));
}
bool operator> ( const int &  x1,
const generic x2 
)

Definition at line 659 of file generic.cpp.

                                                   {
  return generic (x1) > x2; }
bool mmx::operator>= ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 673 of file table.hpp.

                                                              {
  return binary_test<gtreq_op,C,T,V> (t, u); }
bool operator>= ( const string s,
const string t 
)

Definition at line 300 of file string.cpp.

References N().

                                                 {
  register nat i;
  for (i=0; i<N(s1); i++) {
    if (i >= N(s2)) return true;
    if (s1[i] > s2[i]) return true;
    if (s2[i] > s1[i]) return false;
  }
  return true;
}
bool mmx::operator>= ( const table< C, T, V > &  t,
const K &  c 
) [inline]

Definition at line 682 of file table.hpp.

                                         {
  return binary_test_scalar<gtreq_op> (t, c); }
bool operator>= ( const generic x1,
const int &  x2 
)

Definition at line 653 of file generic.cpp.

                                                    {
  return x1 >= generic (x2); }
bool mmx::operator>= ( const vector< int, V > &  v,
const int &  c 
)

Definition at line 1072 of file vector.hpp.

                                                {
  return binary_test_scalar<gtreq_op> (v, c); }
bool mmx::operator>= ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1057 of file vector.hpp.

                                                         {
  return binary_test<gtreq_op> (v, w); }
bool operator>= ( const int &  x1,
const generic x2 
)

Definition at line 661 of file generic.cpp.

                                                    {
  return generic (x1) >= x2; }
bool mmx::operator>= ( const vector< C, V > &  v,
const C &  c 
)

Definition at line 1069 of file vector.hpp.

                                                    {
  return binary_test_scalar<gtreq_op> (v, c); }
bool operator>= ( const generic x1,
const generic x2 
)

Definition at line 642 of file generic.cpp.

References ACC_GTREQ, ACC_TEST, as_bool(), current_ev, and GEN_GTREQ.

                                                   {
  ACC_TEST (ACC_GTREQ, x1, x2);
  return as_bool (current_ev->apply (GEN_GTREQ, x1, x2));
}
port mmx::operator>> ( const port &  in,
char &  c 
) [inline]

Definition at line 167 of file port.hpp.

References read().

                                      {
  read (in, &c, 1);
  return in;
}
generic operator>> ( const generic x1,
const generic x2 
)

Definition at line 794 of file generic.cpp.

References current_ev, and GEN_GTRGTR.

                                                           {
  return current_ev->apply (GEN_GTRGTR, x1, x2); }
heap<C>& mmx::operator>> ( heap< C > &  h,
C &  x 
) [inline]

Definition at line 198 of file heap.hpp.

References pull().

                                              {
  x= pull (h); return h; }
syntactic operator>> ( const syntactic x1,
const syntactic x2 
)

Definition at line 443 of file syntactic.cpp.

References GEN_GTRGTR, and syn().

                                                                 {
  return syn (GEN_GTRGTR, x1, x2); }
generic operator| ( const generic x1,
const generic x2 
)

Definition at line 837 of file generic.cpp.

References current_ev, and GEN_OR.

                                                          {
  return current_ev->apply (GEN_OR, x1, x2); }
table<C,T,V> mmx::operator| ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 627 of file table.hpp.

                                                              {
  return binary_map<or_op,C,T,V> (t, u); }
vector<C,V> mmx::operator| ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1033 of file vector.hpp.

                                                          {
  return binary_map<or_op> (v, w); }
table<C,T,V> mmx::operator|= ( table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 661 of file table.hpp.

                                                         {
  return unary_set<or_op,C,T,V> (t, u); }
static table<string, string> mmx::opname_table ( ) [static]

Definition at line 147 of file cpp_printer.cpp.

References CPP_ACCESS, CPP_AND, CPP_ARROW, CPP_ASSIGN, CPP_BITWISE_AND, CPP_BITWISE_OR, CPP_BITWISE_XOR, CPP_COMPLEMENT, CPP_EQUAL, CPP_GTR, CPP_GTREQ, CPP_GTRGTR, CPP_GTRGTREQ(), CPP_LESS, CPP_LESSEQ, CPP_LESSLESS, CPP_LESSLESSEQ(), CPP_MINUS, CPP_MINUS_ASSIGN, CPP_MOD, CPP_MOD_ASSIGN, CPP_NOT, CPP_OR, CPP_OVER, CPP_OVER_ASSIGN, CPP_PLUS, CPP_PLUS_ASSIGN, CPP_PREDEC, CPP_PREINC, CPP_TIMES, CPP_TIMES_ASSIGN, CPP_UNEQUAL, and SET_OPNAME.

syntactic ordered_product ( const vector< syntactic > &  v)

Definition at line 362 of file syntactic.cpp.

References copy(), N(), and set_frac_flag().

                                             {
  vector<syntactic> w= copy (v);
  sort_leq<product_less_op> (w);
  bool old= set_frac_flag (true);
  syntactic r= 1;
  for (nat i=0; i<N(w); i++) r= r * w[i];
  (void) set_frac_flag (old);
  return r;
}
syntactic ordered_sum ( const vector< syntactic > &  v)

Definition at line 336 of file syntactic.cpp.

References copy(), migrate_negate(), and N().

                                         {
  vector<syntactic> w= copy (v);
  sort_leq<sum_less_op> (w);
  syntactic r= 0;
  for (nat i=0; i<N(w); i++) r= r + w[i];
  return migrate_negate (r, 5);
}
string output_as_mmx ( const generic g)

Definition at line 916 of file mmx_printer.cpp.

References as_generic(), as_mmx(), DATA_BEGIN, DATA_END, flatten(), flatten_as_texmacs_scheme(), and math_mode.

Referenced by operator<<().

                                 {
  if (math_mode) {
    string r;
    r << DATA_BEGIN << "scheme:";
    r << flatten_as_texmacs_scheme (g);
    r << DATA_END;
    return r;
  }
  else {
    generic f= as_generic (flatten (g));
    return as_mmx (f);
  }
}
port output_file_port ( const string name)

Definition at line 96 of file file_port.cpp.

References as_charp(), decode_name(), error_port(), and free_charp().

Referenced by GLUE_3(), and save().

                                      {
  string name_s= decode_name (name);
  char* temp= as_charp (name_s);
  FILE* f= fopen (temp, "w");
  free_charp (temp);
  if (f == NULL) return error_port ("file '" * name * "' not writable");
  return output_file_port (f, true, name);
}
port mmx::output_file_port ( FILE *  f,
bool  close_flag,
const string name 
)

Definition at line 70 of file file_port.cpp.

                                                                {
  return (port_rep*) new file_port_rep (1, f, close_flag, name);
}
observer mmx::output_observer ( dynamic_rep arg)

Definition at line 85 of file dynamic.cpp.

References observer.

Referenced by flatten().

                                   {
  return observer (new output_observer_rep (arg));
}
port output_string_port ( string &  s)

Definition at line 40 of file string_port.cpp.

                               {
  return (port_rep*) new output_string_port_rep (s);
}
static generic mmx::parse_lisp ( const string s,
nat pos,
bool  unquote_flag,
bool  fun_flag 
) [static]

Definition at line 19 of file lisp_parser.cpp.

References N(), parse_lisp(), pos, s, start, unquote(), and vector_to_compound().

                                                                         {
  while (pos < N(s) && s[pos] == ' ') pos++;
  if (s[pos] == '(') {
    vector<generic> v;
    pos++;
    while (pos < N(s) && s[pos] != ')') {
      bool fun= (N(v) == 0);
      v << parse_lisp (s, pos, unquote_flag, fun);
      while (pos < N(s) && s[pos] == ' ') pos++;
    }
    if (pos < N(s)) pos++;
    return vector_to_compound (v);
  }
  else if (unquote_flag && !fun_flag && pos < N(s) && s[pos] == '\"') {
    nat start= pos;
    pos++;
    while (pos < N(s) && s[pos] != '\"')
      if (s[pos] == '\\') pos += 2;
      else pos++;
    if (pos < N(s)) pos++;
    return generic (unquote (s (start, pos)));
  }
  else {
    nat start= pos;
    while (pos < N(s) && s[pos] != ' ' && s[pos] != '(' && s[pos] != ')')
      pos++;
    return generic (s (start, pos));
  }
}
generic parse_lisp ( const string s,
bool  unquote_flag = false 
)
Examples:
generic_test.cpp.

Definition at line 50 of file lisp_parser.cpp.

References pos.

Referenced by flatten_as_tm(), and parse_lisp().

                                                {
  nat pos= 0;
  return parse_lisp (s, pos, unquote_flag, false);
}
string path_name ( const string file_path,
const string file_name 
)

Definition at line 185 of file system.cpp.

References canonical_name(), file_exists(), get_env(), init_system(), load_path(), n, N(), and start.

Referenced by dl_find(), and resolve_name().

                                                             {
  //mmout << "path_name " << file_path << ", " << file_name << "\n";
  if (N (file_name) > 0 && file_name[0] == '/') {
    if (file_exists (file_name)) return canonical_name (file_name);
    else return "";
  }
  else {
    nat i, n= N(file_path), start= 0;
    for (i=0; i<=n; i++)
      if ((i==n) || (file_path[i] == ':')) {
        string ss= file_path (start, i);
        if ((N(ss) > 0) && (ss[0] == '$')) {
          init_system ();
          if (ss == "$MMX_LOAD_PATH") ss= load_path ();
          else ss= get_env (ss (1, N(ss)));
          string r= path_name (ss, file_name);
          if (r != "") return r;
        }
        else {
          if (ss == "" || ss == ".") ss= get_env ("PWD");
          if (ss[N(ss)-1] != '/') ss= ss * "/";
          if (file_exists (ss * file_name))
            return canonical_name (ss * file_name);
        }
        start= i+1;
      }
    return "";
  }
}
C mmx::pi_cst ( ) [inline]

Definition at line 735 of file type_props.hpp.

References C, and set_pi().

{ C r; set_pi (r); return r; }
port pipe_port ( const string cmd)

Definition at line 66 of file pipe_port.cpp.

References composite_port(), IN, OUT, STDERR, STDIN, STDOUT, and system().

Referenced by GLUE_6().

                              {
  int pp_in [2];  // for data going to the child
  int pp_out[2];  // for data coming from the child
  int pp_err[2];  // for error messages coming from the child

  int e1 = pipe (pp_in ); (void) e1;
  int e2 = pipe (pp_out); (void) e2;
  int e3 = pipe (pp_err); (void) e3;
  int pid= fork ();

  if (pid==0) { // the child
    setsid();
    close (pp_in  [OUT]);
    close (pp_out [IN ]);
    close (pp_err [IN ]);
    dup2  (pp_in  [IN ], STDIN );
    close (pp_in  [IN ]);
    dup2  (pp_out [OUT], STDOUT);
    close (pp_out [OUT]);
    dup2  (pp_err [OUT], STDERR);
    close (pp_err [OUT]);

    system (cmd);
    exit (127);
    // exit (system (cmd) != 0);
  }

  else { // the main process
    int in = pp_in  [OUT];
    close (pp_in [IN]);
    int out= pp_out [IN ];
    close (pp_out [OUT]);
    int err= pp_err [IN ];
    close (pp_err [OUT]);

    port pin = pipe_port (1, in , pid, cmd, "in" );
    port pout= pipe_port (2, out, pid, cmd, "out");
    port perr= pipe_port (2, err, pid, cmd, "err");
    return composite_port (vec<port> (pin, pout, perr),
                           vec<string> ("in", "out", "err"));
  }
}
port mmx::pipe_port ( nat  kind,
nat  fd,
nat  pid,
const string cmd,
const string role 
)

Definition at line 57 of file pipe_port.cpp.

                                                                             {
  return (port_rep*) new pipe_port_rep (kind, fd, pid, cmd, role);
}
syntactic polar ( const syntactic g1,
const syntactic g2 
)

Definition at line 431 of file syntactic.cpp.

References exp(), and Imaginary.

                                                           {
  return g1 * exp (g2 * Imaginary (syntactic)); }
generic polar ( const generic x1,
const generic x2 
)

Definition at line 741 of file generic.cpp.

References exp(), and Imaginary.

Referenced by polar_op::set_op().

                                                     {
  return x1 * exp (x2 * Imaginary (generic)); }
generic mmx::postfix ( const generic g,
const generic op 
) [inline]

Definition at line 135 of file mmx_printer.cpp.

References gen().

                                                             {
  return gen ("$postfix", g, op); }
vector<C,V> mmx::pow ( const int &  w,
const vector< C, V > &  v 
)

Definition at line 1096 of file vector.hpp.

                                                {
  return binary_map_scalar<lpow_op> (v, w); }
double pow ( const double &  x,
const int &  y 
) [inline]

Definition at line 63 of file double.hpp.

References pow().

                                                  {
  return std::pow (x, (double) y); }
generic pow ( const generic x1,
const nat x2 
)

Definition at line 542 of file generic.cpp.

References pow().

                                               {
  return pow (x1, generic (x2)); }
generic pow ( const nat x1,
const generic x2 
)

Definition at line 544 of file generic.cpp.

References pow().

                                               {
  return pow (generic (x1), x2); }
generic pow ( const generic x1,
const generic x2 
)

Definition at line 533 of file generic.cpp.

References ACC_BINARY, ACC_POW, current_ev, and GEN_POWER.

                                           {
  ACC_BINARY (ACC_POW, x1, x2);
  return current_ev->apply (GEN_POWER, x1, x2);
}
double pow ( const int &  x,
const double &  y 
) [inline]

Definition at line 65 of file double.hpp.

References pow().

                                                  {
  return std::pow ((double) x, y); }
syntactic pow ( const syntactic g1,
const syntactic g2 
)

Definition at line 289 of file syntactic.cpp.

References abs(), exact_eq(), frac_flag, GEN_OVER, GEN_POWER, GEN_SQRT, pow(), signed_decompose(), and syn().

                                               {
  if (exact_eq (g1, 0)) return 0;
  if (exact_eq (g1, 1)) return 1;
  if (exact_eq (g2, 0)) return 1;
  if (exact_eq (g2, 1)) return g1;
  if (exact_eq (g2, syn (GEN_OVER, syntactic (1), syntactic (2))))
    return syn (GEN_SQRT, g1);
  if (frac_flag) {
    syntactic abs; int sgn;
    signed_decompose (g2, abs, sgn);
    if (sgn < 0) return syn (GEN_OVER, 1, pow (g1, abs));
  }
  return syn (GEN_POWER, g1, g2);
}
syntactic pow ( const int &  g1,
const syntactic g2 
)

Definition at line 310 of file syntactic.cpp.

References flatten(), and pow().

                                         {
  return pow (flatten (g1), g2);
}
generic pow ( const int &  x1,
const generic x2 
)

Definition at line 540 of file generic.cpp.

References pow().

                                               {
  return pow (generic (x1), x2); }
double pow ( const double &  x,
const double &  y 
) [inline]
Examples:
generic_test.cpp.

Definition at line 61 of file double.hpp.

Referenced by apply(), GLUE_11(), GLUE_36(), lpow_op::op(), pow_op::op(), pow(), lpow_op::set_op(), and pow_op::set_op().

                                                     {
  return std::pow (x, y); }
syntactic pow ( const syntactic g1,
const int &  g2 
)

Definition at line 305 of file syntactic.cpp.

References flatten(), and pow().

                                         {
  return pow (g1, flatten (g2));
}
vector<C,V> mmx::pow ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1092 of file vector.hpp.

                                                   {
  return binary_map<pow_op> (v, w); }
generic pow ( const generic x1,
const int &  x2 
)

Definition at line 538 of file generic.cpp.

References pow().

                                               {
  return pow (x1, generic (x2)); }
vector<C,V> mmx::pow ( const vector< C, V > &  v,
const int &  w 
)

Definition at line 1094 of file vector.hpp.

                                                {
  return binary_map_scalar<rpow_op> (v, w); }
xnat precision ( const generic x)

Definition at line 763 of file generic.cpp.

References ASSERT, current_ev, and GEN_PRECISION.

                                  {
  generic r= current_ev->apply (GEN_PRECISION, x);
  ASSERT (is<int> (r), "Int return value expected");
  return as<int> (r); }
xnat mmx::precision ( const vector< C, V > &  v) [inline]

Definition at line 1141 of file vector.hpp.

                                             {
  return big<min_precision_op> (v); }
xnat mmx::precision ( const double &  x) [inline]

Definition at line 82 of file double.hpp.

Referenced by GLUE_38(), precision_op::op(), min_precision_op::set_op(), and precision_op::set_op().

{ (void) x; return 51; }
generic mmx::prefix ( const generic op,
const generic g 
) [inline]

Definition at line 137 of file mmx_printer.cpp.

References gen().

                                                            {
  return gen ("$prefix", op, g); }
string prefix_dir ( )

Definition at line 100 of file system.cpp.

References BASIX_PREFIX, eval_system(), file_exists(), and get_env().

Referenced by dl_find(), load_path(), and sysconf_dir().

              {
  string dir= get_env ("MMX_PREFIX_DIR");
  if (dir == "") dir= string (BASIX_PREFIX);
  if (!file_exists (dir)) dir= eval_system ("basix-config --prefix");
  return dir;
}
generic prime ( const generic x1)

Definition at line 693 of file generic.cpp.

References current_ev.

                                  {
  return current_ev->apply ("'", x1); }
generic print_mmx ( const generic g)

Definition at line 893 of file mmx_printer.cpp.

References concat(), GEN_BEGIN, is_C0(), is_func(), N(), and mmx_printer::pp_E0().

Referenced by as_mmx(), as_snippet(), as_texmacs_scheme(), and as_texmacs_snippet().

                             {
  vector<generic> v;
  mmx_printer pp;
  if (is_func (g, GEN_BEGIN))
    for (nat i=1; i<N(g); i++)
      v << pp.pp_C0 (g[i], i<N(g)-1);
  else if (is_C0 (g)) v << pp.pp_C0 (g);
  else v << pp.pp_E0 (g);
  return concat (v);
}
syntactic project ( const syntactic x,
const syntactic y 
)

Definition at line 487 of file syntactic.cpp.

References syn().

Referenced by mv_project_op::op(), project_helper< R >::op(), project_op::Project_type(), and mv_project_op::set_op().

                                                           {
  return syn ("project", x, y); }
T promote ( const F &  x,
const T &  y 
) [inline]
bool mmx::promote ( const F &  x,
const bool &   
) [inline]

Definition at line 29 of file defaults.hpp.

{ return as<bool> (x); }
char mmx::promote ( const F &  x,
const char &   
) [inline]

Definition at line 31 of file defaults.hpp.

{ return as<char> (x); }
signed char mmx::promote ( const F &  x,
const signed char &   
) [inline]

Definition at line 33 of file defaults.hpp.

{ return as<signed char> (x); }
unsigned char mmx::promote ( const F &  x,
const unsigned char &   
) [inline]

Definition at line 35 of file defaults.hpp.

{ return as<unsigned char> (x); }
int mmx::promote ( const F &  x,
const int &   
) [inline]

Definition at line 37 of file defaults.hpp.

{ return as<int> (x); }
unsigned int mmx::promote ( const F &  x,
const unsigned int &   
) [inline]

Definition at line 39 of file defaults.hpp.

{ return as<unsigned int> (x); }
long int mmx::promote ( const F &  x,
const long int &   
) [inline]

Definition at line 41 of file defaults.hpp.

{ return as<long int> (x); }
unsigned long int mmx::promote ( const F &  x,
const unsigned long int &   
) [inline]

Definition at line 43 of file defaults.hpp.

                                               {
  return as<unsigned long int> (x); }
long long int mmx::promote ( const F &  x,
const long long int &   
) [inline]

Definition at line 46 of file defaults.hpp.

{ return as<long long int> (x); }
unsigned long long int mmx::promote ( const F &  x,
const unsigned long long int &   
) [inline]

Definition at line 48 of file defaults.hpp.

                                                    {
  return as<unsigned long long int> (x); }
float mmx::promote ( const F &  x,
const float &   
) [inline]

Definition at line 51 of file defaults.hpp.

{ return as<float> (x); }
double mmx::promote ( const F &  x,
const double &   
) [inline]

Definition at line 53 of file defaults.hpp.

{ return as<double> (x); }
T mmx::promote ( const F &  x,
const format< T > &  fm 
) [inline]

Definition at line 636 of file type_props.hpp.

References get_sample(), and promote().

                                          {
  return promote (x, get_sample (fm));
}
scalar_type_helper< T >::val mmx::promote_scalar ( const F &  x,
const T &  y 
) [inline]

Definition at line 477 of file type_props.hpp.

References T.

Referenced by zero_scalar().

                                        {
  return promote_scalar_helper<typename format<T>::FT,F,T>::op (x, y);
}
C pull ( heap< C > &  h) [inline]
Examples:
heap_test.cpp.

Definition at line 191 of file heap.hpp.

Referenced by heap_iterator_rep< C >::advance(), binary_test(), operator>>(), unary_hash(), and binary_helper< heap< C > >::write().

                             {
  h.secure(); return h.rep->Pull (); }
void push ( heap< C > &  h,
const C &  x 
) [inline]

Definition at line 189 of file heap.hpp.

Referenced by binary_helper< heap< C > >::assemble(), operator<<(), and binary_helper< heap< C > >::read().

                                            {
  h.secure(); h.rep->Push (x); }
routine mmx::quaternary_routine ( const generic name,
D(*)(const S1 &, const S2 &, const S3 &, const S4 &)  f 
)

Definition at line 368 of file routine.hpp.

Referenced by define().

                                                                        {
  return new quaternary_routine_rep<D,S1,S2,S3,S4> (name, f);
}
routine mmx::quintary_routine ( const generic name,
D(*)(const S1 &, const S2 &, const S3 &, const S4 &, const S5 &)  f 
)

Definition at line 429 of file routine.hpp.

Referenced by define().

                                                 {
  return new quintary_routine_rep<D,S1,S2,S3,S4,S5> (name, f);
}
table<C,T,V> mmx::quo ( const table< C, T, V > &  t,
const K &  sc 
) [inline]

Definition at line 648 of file table.hpp.

                                  {
  return binary_map_scalar<rquo_op> (t, sc); }
table<C,T,V> mmx::quo ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 623 of file table.hpp.

                                                       {
  return binary_map<quo_op,C,T,V> (t, u); }
signed char mmx::quo ( const signed char &  n,
const signed char &  m 
) [inline]

Definition at line 431 of file int.hpp.

{
int mmx::quo ( const int &  n,
const int &  m 
) [inline]

Definition at line 433 of file int.hpp.

{
long long int mmx::quo ( const long long int &  n,
const long long int &  m 
) [inline]

Definition at line 435 of file int.hpp.

{
unsigned short int mmx::quo ( const unsigned short int &  n,
const unsigned short int &  m 
) [inline]

Definition at line 437 of file int.hpp.

{
unsigned int mmx::quo ( const unsigned int &  n,
const unsigned int &  m 
) [inline]

Definition at line 438 of file int.hpp.

{
unsigned long int mmx::quo ( const unsigned long int &  n,
const unsigned long int &  m 
) [inline]

Definition at line 439 of file int.hpp.

{
unsigned long long int mmx::quo ( const unsigned long long int &  n,
const unsigned long long int &  m 
) [inline]

Definition at line 440 of file int.hpp.

{
unsigned char mmx::quo ( const unsigned char &  n,
const unsigned char &  m 
) [inline]

Definition at line 436 of file int.hpp.

{
vector<C,V> mmx::quo ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1005 of file vector.hpp.

                                                   {
  return binary_map<quo_op> (v, w); }
short int mmx::quo ( const short int &  n,
const short int &  m 
) [inline]

Definition at line 432 of file int.hpp.

{
long int mmx::quo ( const long int &  n,
const long int &  m 
) [inline]

Definition at line 434 of file int.hpp.

{
vector<C,V> mmx::quo ( const vector< C, V > &  v,
const C &  c 
)

Definition at line 1029 of file vector.hpp.

                                              {
  return binary_map_scalar<rquo_op> (v, c); }
C mmx::quo ( const C &  x,
const D &  y 
) [inline]

Definition at line 339 of file defaults.hpp.

References promote().

Referenced by quo_op::def(), GLUE_11(), rquo_op::op(), quo_op::op(), rquo_op::set_op(), quo_op::set_op(), and skew_quo().

                             { // NOTE: by default we divide on the right
  if (y == promote (0, y)) return promote (0, x); else return x/y; }
generic quo ( const generic x1,
const generic x2 
)

Definition at line 708 of file generic.cpp.

References current_ev, and GEN_DIV.

                                                   {
  return current_ev->apply (GEN_DIV, x1, x2); }
syntactic radius ( const syntactic g1)

Definition at line 435 of file syntactic.cpp.

References GEN_RADIUS, and syn().

{ return syn (GEN_RADIUS, g1); }
vector<Radius_type(C),V> mmx::radius ( const vector< C, V > &  v)

Definition at line 1160 of file vector.hpp.

                                            {
  return unary_map<radius_op> (v); }
generic radius ( const generic x1)

Definition at line 822 of file generic.cpp.

References current_ev.

Referenced by radius_op::Radius_type(), and radius_op::set_op().

                                   {
  return current_ev->apply ("radius", x1); }
unary_return_type_helper<abs_op, C >::RET mmx::radius ( const C &  x) [inline]

Definition at line 890 of file type_props.hpp.

{ return 0; }
chain<C> mmx::range ( const chain< C > &  c,
nat  start,
nat  end 
)
Examples:
chain_test.cpp.

Definition at line 335 of file chain.hpp.

References ASSERT, C, Chain, is_nil(), left(), middle(), N(), n, and right().

Referenced by cDr(), cdr(), detach(), GLUE_7(), GLUE_8(), range(), and store_interactive_number().

                                           {
  if (start >= end) return Chain ();
  ASSERT (!is_nil (c), "non-empty chain expected");
  nat n= N (left (c));
  if (end <= n) return range (left (c), start, end);
  if (start > n) return range (right (c), start-n-1, end-n-1);
  Chain l= range (left (c), start, n);
  C     m= middle (c);
  Chain r= range (right (c), 0, end-n-1);
  if (N(l) < 2*(N(r) + 1) && N(r) < 2*(N(l) + 1)) return Chain (l, m, r);
  return l * Chain (m) * r;
}
vector<C,V> mmx::range ( const vector< C, V > &  v,
nat  start,
nat  end 
)

Definition at line 562 of file vector.hpp.

References C, CF(), copy(), is_a_scalar(), n, seg(), start, Vector, and VERIFY.

                                            {
  typedef implementation<vector_linear,V> Vec;
  VERIFY(end >= start, "bad range");
  nat n= end - start;
  if (is_a_scalar (v)) return Vector (v.scalar(), n);
  nat l= aligned_size<C,V> (n);
  C* a= mmx_formatted_new<C> (l, CF(v));
  Vec::copy (a, seg (v) + start, n);
  return Vector (a, n, l, CF(v));
}
list<C> mmx::range ( const list< C > &  l,
nat  start,
nat  end 
)

Return a copy of the sublist of l from positions start to end.

Definition at line 305 of file list.hpp.

References ASSERT, car(), cdr(), cons(), is_nil(), List, and range().

                                          {
  if (start >= end) return List ();
  ASSERT (!is_nil (l), "non-empty list expected");
  if (start > 0) return range (cdr (l), start-1, end-1);
  return cons (car (l), range (cdr (l), 0, end-1));
}
generic range ( const generic g,
nat  start,
nat  end 
)

Definition at line 24 of file generic_utils.cpp.

References compound_to_vector(), range(), and vector_to_compound().

                                             {
  return vector_to_compound (range (compound_to_vector (g), start, end));
}
iterator<C> mmx::range_iterator ( const C &  start,
const C &  end,
const C &  step = C(1),
bool  strict = true 
)

Definition at line 352 of file iterator.hpp.

References Iterator.

{
  return Iterator (new range_iterator_rep<C> (start, end, step, strict));
}
void mmx::raw_read ( M &  m,
const char *  p,
nat  n 
)

Definition at line 798 of file type_props.hpp.

References busy(), n, and VERIFY.

Referenced by raw_read_length().

                                      {
  for (nat i=0; i<n; i++) {
    VERIFY (busy (m), "read failed");
    m >> p[i];
  }
}
void mmx::raw_read_length ( M &  m,
nat &  l 
)

Definition at line 815 of file type_props.hpp.

References raw_read().

                               {
  char c;
  m >> c;
  if (c != ((char) 255)) l= (nat) ((uchar) c);
  else raw_read (m, (char*) ((void)* (&l)), sizeof (nat));
}
void mmx::raw_write ( M &  m,
const char *  p,
nat  n 
)

Definition at line 793 of file type_props.hpp.

References n.

Referenced by raw_write_length().

                                       {
  for (nat i=0; i<n; i++) m << p[i];
}
void mmx::raw_write_length ( M &  m,
nat  l 
)

Definition at line 806 of file type_props.hpp.

References raw_write().

                               {
  if (l < (nat) 255) m << ((char) l);
  else {
    m << ((char) 255);
    raw_write (m, (const char*) ((const void*) (&l)), sizeof (nat));
  }
}
syntactic Re ( const syntactic g1)

Definition at line 424 of file syntactic.cpp.

References GEN_RE, and syn().

{ return syn (GEN_RE, g1); }
generic Re ( const generic x1)

Definition at line 733 of file generic.cpp.

References current_ev, and GEN_RE.

                               {
  return current_ev->apply (GEN_RE, x1); }
C mmx::Re ( const C &  x) [inline]

Definition at line 712 of file defaults.hpp.

Referenced by Re_op::op(), Re_op::Real_type(), and Re_op::set_op().

{ return x; }
vector<Real_type(C),V> mmx::Re ( const vector< C, V > &  v)

Definition at line 1154 of file vector.hpp.

{ return unary_map<Re_op> (v); }
const C& mmx::read ( const table< C, T, V > &  t,
const T &  x 
) [inline]

Definition at line 173 of file table.hpp.

                                                       {
  return t[x]; }
const C& mmx::read ( const table< C, T, V > &  t,
const K &  x 
) [inline]

Definition at line 162 of file table.hpp.

                                                        {
  return t[as<T> (x)]; }
const C& mmx::read ( const vector< C, V > &  v,
nat  i 
) [inline]

Definition at line 206 of file vector.hpp.

{ return v[i]; }
void mmx::read ( const port &  p,
char *  s,
nat  n 
) [inline]

Definition at line 109 of file port.hpp.

References inside().

                                                 {
  inside (p)->read (s, n); }
string mmx::read ( const port &  p,
nat  n 
) [inline]

Definition at line 111 of file port.hpp.

References inside().

                                          {
  string r (n); inside (p)->read (inside (r, 0), n); return r; }
const C& mmx::read_car ( const list< C > &  l) [inline]
const list<C>& mmx::read_cdr ( const list< C > &  l) [inline]
const C & read_I ( const table< C, T, V > &  t) [inline]

Definition at line 213 of file table.hpp.

Referenced by REP_STRUCT_2(), and unary_set().

                        {
  t->lazy_initialize ();
  return *t->init;
}
const C& mmx::read_only ( const C &  c) [inline]

Definition at line 758 of file defaults.hpp.

Referenced by list< cleaner >::operator[]().

                       {
  return c;
}
static bool mmx::reads ( const string s,
nat  pos,
const string what 
) [static]

Definition at line 501 of file string.cpp.

References N().

Referenced by replace(), search_backwards(), and search_forwards().

                                                     {
  nat i, n= N(s), l= N(what);
  for (i=0; pos+i<n && i<l; i++)
    if (s[pos+i] != what[i]) return false;
  return i == l;
}
static generic mmx::rebuild ( const vector< generic > &  v) [static]

Definition at line 20 of file glue_vector_map.cpp.

References apply(), eval(), is_a_scalar(), and vector< C, V >::scalar().

                                   {
  if (is_a_scalar (v)) {
    generic make_vector= eval ("scalar_vector");
    return as<routine> (make_vector) -> apply (vec<generic> (v.scalar()));
  }
  else {
    generic make_vector= eval ("vector");
    return as<routine> (make_vector) -> apply (v);
  }
}
static generic mmx::rebuild ( const list< generic > &  l) [static]

Definition at line 30 of file glue_list_map.cpp.

References apply(), and eval().

Referenced by list_append_several(), list_map(), vector_append_several(), and vector_map().

                                 {
  generic make_list= eval ("list");
  return as<routine> (make_list) -> apply (as_vector<generic> (l));
}
string recompose ( const vector< string > &  v,
const string sep,
bool  last = true 
)

Reconstruct string from pieces in using as a separator.

Definition at line 562 of file string.cpp.

References N(), and s.

Referenced by add_indentation(), get_file_source(), and get_interactive_source().

                                                                  {
  string s;
  for (nat i=0; i<N(v); i++) {
    s << v[i];
    if (i+1 < N(v) || last) s << sep;
  }
  return s;
}
void mmx::register_glue ( const string s,
void(*)()  f 
)

Definition at line 113 of file glue.cpp.

References glue_table, and inside_set().

                                                   {
  inside_set (glue_table (), s, f);
}
void mmx::register_glue ( const string ,
void(*)(void)   
)
string relative_name ( const string base,
const string name 
)

Definition at line 278 of file system.cpp.

References canonical_name(), and N().

Referenced by resolve_name().

                                                       {
  string file_name= name;
  if (base != "" && file_name != "" && file_name[0] != '/') {
    int i;
    for (i= N(base)-1; i>=0; i--)
      if (base[i] == '/') break;
    file_name= base (0, i+1) * file_name;
  }
  return canonical_name (file_name);
}
table<C,T,V> mmx::rem ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 625 of file table.hpp.

                                                       {
  return binary_map<rem_op,C,T,V> (t, u); }
unsigned long long int mmx::rem ( const unsigned long long int &  n,
const unsigned long long int &  m,
unsigned long long int &  q 
) [inline]

Definition at line 440 of file int.hpp.

{
table<C,T,V> mmx::rem ( const table< C, T, V > &  t,
const K &  sc 
) [inline]

Definition at line 651 of file table.hpp.

                                  {
  return binary_map_scalar<rrem_op> (t, sc); }
short int mmx::rem ( const short int &  n,
const short int &  m,
short int &  q 
) [inline]

Definition at line 432 of file int.hpp.

{
long int mmx::rem ( const long int &  n,
const long int &  m,
long int &  q 
) [inline]

Definition at line 434 of file int.hpp.

{
C mmx::rem ( const C &  x,
const D &  y 
) [inline]

Definition at line 342 of file defaults.hpp.

References promote().

Referenced by GLUE_12(), rrem_op::op(), rem_op::op(), rrem_op::set_op(), rem_op::set_op(), and skew_rem().

                             { // NOTE: by default we divide on the right
  if (y == promote (0, y)) return x; else return promote (0, x); }
long long int mmx::rem ( const long long int &  n,
const long long int &  m 
) [inline]

Definition at line 435 of file int.hpp.

{
signed char mmx::rem ( const signed char &  n,
const signed char &  m 
) [inline]

Definition at line 431 of file int.hpp.

{
long long int mmx::rem ( const long long int &  n,
const long long int &  m,
long long int &  q 
) [inline]

Definition at line 435 of file int.hpp.

{
unsigned short int mmx::rem ( const unsigned short int &  n,
const unsigned short int &  m,
unsigned short int &  q 
) [inline]

Definition at line 437 of file int.hpp.

{
unsigned long int mmx::rem ( const unsigned long int &  n,
const unsigned long int &  m 
) [inline]

Definition at line 439 of file int.hpp.

{
unsigned long int mmx::rem ( const unsigned long int &  n,
const unsigned long int &  m,
unsigned long int &  q 
) [inline]

Definition at line 439 of file int.hpp.

{
unsigned char mmx::rem ( const unsigned char &  n,
const unsigned char &  m 
) [inline]

Definition at line 436 of file int.hpp.

{
signed char mmx::rem ( const signed char &  n,
const signed char &  m,
signed char &  q 
) [inline]

Definition at line 431 of file int.hpp.

{
vector<C,V> mmx::rem ( const vector< C, V > &  v,
const C &  c 
)

Definition at line 1031 of file vector.hpp.

                                              {
  return binary_map_scalar<rrem_op> (v, c); }
unsigned int mmx::rem ( const unsigned int &  n,
const unsigned int &  m 
) [inline]

Definition at line 438 of file int.hpp.

{
unsigned long long int mmx::rem ( const unsigned long long int &  n,
const unsigned long long int &  m 
) [inline]

Definition at line 440 of file int.hpp.

{
unsigned char mmx::rem ( const unsigned char &  n,
const unsigned char &  m,
unsigned char &  q 
) [inline]

Definition at line 436 of file int.hpp.

{
short int mmx::rem ( const short int &  n,
const short int &  m 
) [inline]

Definition at line 432 of file int.hpp.

{
unsigned int mmx::rem ( const unsigned int &  n,
const unsigned int &  m,
unsigned int &  q 
) [inline]

Definition at line 438 of file int.hpp.

{
long int mmx::rem ( const long int &  n,
const long int &  m 
) [inline]

Definition at line 434 of file int.hpp.

{
unsigned short int mmx::rem ( const unsigned short int &  n,
const unsigned short int &  m 
) [inline]

Definition at line 437 of file int.hpp.

{
int mmx::rem ( const int &  n,
const int &  m 
) [inline]

Definition at line 433 of file int.hpp.

{
vector<C,V> mmx::rem ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1007 of file vector.hpp.

                                                   {
  return binary_map<rem_op> (v, w); }
int mmx::rem ( const int &  n,
const int &  m,
int &  q 
) [inline]

Definition at line 433 of file int.hpp.

{
generic rem ( const generic x1,
const generic x2 
)

Definition at line 710 of file generic.cpp.

References current_ev, and GEN_MOD.

                                                   {
  return current_ev->apply (GEN_MOD, x1, x2); }
vector<C,V> mmx::remove ( const vector< C, V > &  v,
vector< nat e 
)

Definition at line 592 of file vector.hpp.

References N(), n, and Vector.

                                        {
  nat n= N(v);
  vector<nat> f ((nat) 0, n);
  for (nat i= 0; i < n; i++) f[i]= i;
  for (nat i= 0; i < N(e); i++) if (e[i] < n) f[e[i]]= n;
  Vector r;
  for (nat i= 0; i < n; i++) {
    if (f[i] == n) continue;
    r << v[i];
  }
  return r;
}
class vector_rep< C, vector_fixed< V, S > > mmx::REP_STRUCT_1 ( )

Definition at line 318 of file vector.hpp.

References C, Format, FVector, is_a_scalar(), is_non_scalar(), LESSGTR, N(), n, seg(), val, Vector, and VERIFY.

                                  {
  C* a;
public:
  /*
  inline vector_rep (C* a2, nat n, bool dummy):
    a (a2) {
      VERIFY (n == S::val, "wrong size");
      (void) n; (void) dummy; }
  inline vector_rep (C* a2, nat n, nat l, bool dummy):
    a (a2) {
      VERIFY (n == S::val, "wrong size");
      VERIFY ((l == aligned_size<C,V> (S::val)), "wrong allocated size");
      (void) n; (void) l; (void) dummy; }
  */
  inline vector_rep (C* a2, nat n, bool dummy, const Format& fm):
    Format (fm), a (a2) {
      VERIFY (n == S::val, "wrong size");
      (void) n; (void) dummy; }
  inline vector_rep (C* a2, nat n, nat l, bool dummy, const Format& fm):
    Format (fm), a (a2) {
      VERIFY (n == S::val, "wrong size");
      VERIFY ((l == aligned_size<C,V> (S::val)), "wrong allocated size");
      (void) n; (void) l; (void) dummy; }
  inline virtual ~vector_rep () {
    mmx_delete<C> (a, aligned_size<C,V> (S::val)); }
  friend class FVector;
  friend nat N LESSGTR (const FVector& v);
  friend C*  seg LESSGTR (FVector& v);
  friend const C* seg LESSGTR (const FVector& v);
  friend bool is_a_scalar   LESSGTR (const Vector& v);
  friend bool is_non_scalar LESSGTR (const Vector& v);
};
class vector_rep mmx::REP_STRUCT_1 ( )

Definition at line 46 of file vector.hpp.

References C, copy(), Format, is_a_scalar(), is_non_scalar(), LESSGTR, max(), min(), N(), n, seg(), and Vector.

                                 {
public:
  typedef implementation<vector_linear,V> Vec;
private:
  C*   a;           // entries of vector
  nat  n;           // dimension of vector
  nat  l;           // allocated number of entries
  bool scalar_flag; // is the vector a scalar value?
public:
  inline vector_rep (C* a2, nat n2, bool flag, const Format& fm):
    Format (fm), a (a2), n (n2), l (n2), scalar_flag (flag) {}
  inline vector_rep (C* a2, nat n2, nat l2, bool flag, const Format& fm):
    Format (fm), a (a2), n (n2), l (l2), scalar_flag (flag) {}
  inline ~vector_rep () { mmx_delete<C> (a, l); }
  void resize (nat n2) {
    nat l2;
    if (n2 > l) l2= aligned_size<C,V> (max (n2, l<<1));
    else if (n2 < (l >> 1)) l2= aligned_size<C,V> (n2);
    else { n= n2; return; }
    C* b= mmx_new<C> (l2);
    Vec::copy (b, a, min (n, n2));
    mmx_delete<C> (a, l);
    a= b;
    n= n2;
    l= l2;
  }
  friend class Vector;
  friend nat N LESSGTR (const Vector& v);
  friend C* seg LESSGTR (Vector& v);
  friend const C* seg LESSGTR (const Vector& v);
  friend bool is_a_scalar   LESSGTR (const Vector& v);
  friend bool is_non_scalar LESSGTR (const Vector& v);
};
class iterator_rep mmx::REP_STRUCT_1 ( )

Definition at line 38 of file iterator.hpp.

References busy(), C, copy(), done(), ERROR, exact_hash(), Format, hash(), init(), Iterator, Iterator_rep, and LESSGTR.

                                   {
protected:
  virtual bool is_busy () = 0;
  virtual bool is_done () { return !is_busy (); }
  virtual bool is_init () {
    ERROR ("not implemented (is_init)"); return false; }
  virtual void advance () = 0;
  virtual void regress () {
    ERROR ("not implemented (regress)"); }
  virtual C current () = 0;
  virtual Iterator_rep* clone () {
    ERROR ("not implemented (clone)"); return NULL; }

public:
  inline iterator_rep () {}
  inline iterator_rep (const Format& fm): Format (fm) {}
  virtual ~iterator_rep () {}
  friend class Iterator;
  friend bool busy LESSGTR (const Iterator& it);
  friend bool done LESSGTR (const Iterator& it);
  friend bool init LESSGTR (const Iterator& it);
  friend nat  hash LESSGTR (const Iterator& it);
  friend nat  exact_hash LESSGTR (const Iterator& it);
  friend Iterator copy LESSGTR (const Iterator& it);
};
class table_rep mmx::REP_STRUCT_2 ( ,
 
)

Definition at line 64 of file table.hpp.

References C, contains(), Format1, Format2, get_format(), I(), init(), LESSGTR, mmx_new(), N(), n, read_I(), reset(), simplify(), size(), T, Table, and Table_rep.

                                  {
  nat size;             // size of table (nr of entries)
  nat n;                // nr of keys (a power of two)
  C*  init;             // default entry
  list<pair<T,C> >* a;  // the array of entries

public:
  Table_rep (nat n2, const Format1& fm1, const Format2& fm2):
    encapsulate1<Format1 > (fm1),
    encapsulate2<Format2 > (fm2),
    size (0), n (n2),
    init (NULL),
    a (mmx_new<list<pair<T,C> > > (n))
  {
    //mmout << "[+init=" << init << "," << this
    //<< "]" << flush_now;
  }
  Table_rep (const C& init2, nat n2, const Format2& fm2):
    encapsulate1<Format1 > (get_format (init2)),
    encapsulate2<Format2 > (fm2),
    size (0), n (n2),
    init (mmx_new_one<C> (init2)),
    a (mmx_new<list<pair<T,C> > > (n))
  {
    //mmout << "[+init=" << init << "," << this
    //<< ";" << ((int*) ((void*) init))[-1]
    //<< "]" << flush_now;
  }
  ~Table_rep () {
    //mmout << "[-init=" << init << "," << this;
    //if (init != NULL)
    //mmout << ";" << ((int*) ((void*) init))[-1];
    //mmout << "]" << flush_now;
    if (init != NULL) mmx_delete_one<C> (init);
    mmx_delete<list<pair<T,C> > > (a, n); }
  inline void lazy_initialize () const {
    if (init == NULL) {
      *((C**) ((void*) &init))= mmx_new_one<C> ();
      //mmout << "[:init=" << init << "," << this
      //<< ";" << ((int*) ((void*) init))[-1]
      //<< "]" << flush_now;
    }
  }
  void resize (nat n);
  void reset (const T& x);
  bool contains (const T& x) const;
  bool get (const T& x, C& y) const;
  const C& get (const T& x) const;
  C& set (const T& x);
  void simplify ();
  double complexity () const;

  friend class Table;
  friend class entries_iterator_rep<C,T,V>;
  friend class table_iterator_rep<C,T,V>;
  friend C& I LESSGTR (Table& t);
  friend const C& I LESSGTR (const Table& t);
  friend const C& read_I LESSGTR (const Table& t);
  friend nat N LESSGTR (const Table& t);
  friend bool operator == LESSGTR (const Table& t1, const Table& t2);
};
string repeated ( const string s,
nat  n 
)

Definition at line 576 of file string.cpp.

References n.

Referenced by add_indentation(), and source_string_unindented().

                                  {
  string r;
  for (nat i=0; i<n; i++) r << s;
  return r;
}
string replace ( const string s,
const string what,
const string by 
)

Replace all the occurences of what by in s.

Definition at line 509 of file string.cpp.

References n, N(), and reads().

Referenced by GLUE_12().

                                                                {
  nat i, n= N(s);
  string r;
  for (i=0; i<n; )
    if (reads (s, i, what)) { r << by; i += N(what); }
    else r << s[i++];
  return r;
}
generic mmx::replace_lf ( const generic g)

Definition at line 359 of file mmx_texmacs.cpp.

References ERROR, gen(), is_func(), mmout, N(), and type_name().

Referenced by as_snippet(), as_texmacs_scheme(), and as_texmacs_snippet().

                              {
  if (is<literal> (g)) return g;
  else if (is_func (g, "$concat")) {
    bool block= false;
    vector<generic> d;
    vector<generic> c;
    for (nat i=1; i<N(g); i++) {
      if (is_func (g[i], "$lf", 0)) {
        if (N(c) == 0) d << generic ("");
        else if (N(c) == 1) d << c;
        else if (N(c) > 1) d << gen ("$concat", c);
        c= vector<generic> ();
      }
      else if (is_func (g[i], "$cr", 0)) block= true;
      else c << replace_lf (g[i]);
    }
    if (N(c) == 1) d << c;
    else if (N(c) != 0) d << gen ("$concat", c);
    if (N(d) != 1 || block) return gen ("$document", d);
    return d[0];
  }
  else if (is<compound> (g)) {
    vector<generic> v;
    for (nat i=1; i<N(g); i++)
      v << replace_lf (g[i]);
    return gen (g[0], v);
  }
  else {
    mmout << "g= " << g << ": " << type_name (g) << "\n";
    ERROR ("TeXmacs document expected");
  }
}
void mmx::reset ( table< C, T, V > &  t,
const K &  x 
) [inline]
Examples:
table_test.cpp.

Definition at line 164 of file table.hpp.

References inside().

Referenced by alias_reset(), REP_STRUCT_2(), reset(), source_delete(), unary_set(), and posix_port_rep::~posix_port_rep().

                                               {
  t.secure(); inside (t) -> reset (as<T> (x)); }
void mmx::reset ( table< C, T, V > &  t,
const T &  x 
) [inline]

Definition at line 175 of file table.hpp.

References inside(), and reset().

                                              {
  t.secure(); inside (t) -> reset (x); }
string resolve_name ( const string base,
const string name 
)

Definition at line 290 of file system.cpp.

References canonical_name(), file_exists(), get_directory(), N(), path_name(), and relative_name().

                                                      {
  //mmout << "Resolve " << base << ", " << name << "\n";
  string r= relative_name (base, name);
  if (file_exists (r)) return r;
  if (get_directory (name) != ".") {
    r= relative_name (canonical_name (base * "/.."), name);
    if (file_exists (r)) return r;
  }
  r= path_name ("$MMX_LOAD_PATH", name);
  if (r != "") return r;
  nat i;
  for (i=0; i<N(name); i++)
    if (name[i] == '/') break;
  if (i == N(name)) return "";
  string d= name (0, i);
  string f= name (i+1, N(name));
  r= path_name ("$MMX_LOAD_PATH", d * "/mmx/" * f);
  if (r != "") return r;
  r= path_name ("$MMX_LOAD_PATH", d * "/glue/" * f);
  if (r != "") return r;
  return "";
}
void restore_evaluator ( )

Definition at line 79 of file evaluator.cpp.

References ASSERT, current_ev, is_nil(), read_car(), read_cdr(), and stack_ev.

                     {
  //assert (!ev_lock);
  //ev_lock= true;
  //{
  ASSERT (!is_nil (stack_ev), "empty evaluator stack");
  /*
    if (N(stack_ev) < 6)
    mmout << "[" << N (stack_ev)-1
    << ":" << inside (current_ev)
    << "-" << inside (car (stack_ev))
    << "]" << flush_now;
  */
  evaluator aux_ev= current_ev; // only destroy current_ev on exit
  current_ev= read_car (stack_ev);
  stack_ev  = read_cdr (stack_ev);
  //}
  //ev_lock= false;
}
observer mmx::result_observer ( dynamic_rep arg,
const updater u 
)

Definition at line 169 of file dynamic.cpp.

References observer.

                                                     {
  return observer (new result_observer_rep (arg, u));
}
string reverse ( const string s)

Reverse the order of the characters in s.

Definition at line 533 of file string.cpp.

References n, and N().

                          {
  nat i, n= N(s);
  string r (n);
  for (i=0; i<n; i++) r[i]= s[n-1-i];
  return r;
}
chain<C> mmx::reverse ( const chain< C > &  c)
Examples:
chain_test.cpp.

Definition at line 201 of file chain.hpp.

References Chain, is_nil(), left(), middle(), and right().

Referenced by GLUE_8(), GLUE_9(), reverse_op::op(), and reverse_op::set_op().

                         {
  if (is_nil (c)) return c;
  return Chain (reverse (right (c)), middle (c), reverse (left (c)));
}
list<C> mmx::reverse ( const list< C > &  ll)

Return the reversed list of l.

Definition at line 294 of file list.hpp.

References cons(), is_nil(), List, read_car(), and read_cdr().

                         {
  List l= ll, r;
  while (!is_nil (l)) {
    r= cons (read_car (l), r);
    l= read_cdr (l);
  }
  return r;
}
vector<C,V> mmx::reverse ( const vector< C, V > &  v)

Definition at line 678 of file vector.hpp.

References C, CF(), is_a_scalar(), N(), n, seg(), and Vector.

                          {
  typedef implementation<vector_linear,V> Vec;
  if (is_a_scalar (v)) return v;
  nat n= N(v);
  nat l= aligned_size<C,V> (n);
  C* a= mmx_formatted_new<C> (l, CF(v));
  Vec::vec_reverse (a, seg (v), n);
  return Vector (a, n, l, CF(v));
}
double round ( const double &  x) [inline]

Definition at line 128 of file double.hpp.

References floor().

Referenced by round_op::op(), and round_op::set_op().

{ return std::floor (x + 0.5); }
generic round ( const generic x)

Definition at line 754 of file generic.cpp.

References current_ev, and GEN_ROUND.

                                 {
  return current_ev->apply (GEN_ROUND, x); }
double rounding_error ( const double &  x) [inline]

Definition at line 85 of file double.hpp.

References abs().

Referenced by rounding_error_op::Abs_type(), additive_error(), elementary_error(), GLUE_45(), multiplicative_error(), and rounding_error_op::set_op().

                                               {
  return ldexp (abs (x), -50) + __DBL_MIN__; }
generic rounding_error ( const generic x)

Definition at line 771 of file generic.cpp.

References current_ev, and GEN_ROUNDING_ERROR.

                                          {
  return current_ev->apply (GEN_ROUNDING_ERROR, x); }
unary_return_type_helper<abs_op, C >::RET mmx::rounding_error ( const C &  x) [inline]

Definition at line 866 of file type_props.hpp.

References abs(), and promote().

                                                                    {
  return promote (0, abs (x)); }
generic rres ( const generic x1,
const generic x2 
)

Definition at line 843 of file generic.cpp.

References current_ev.

                                                    {
  return current_ev->apply ("rres", x1, x2); }
void mmx::rshift2 ( C &  x,
const C &  y,
const S &  z 
) [inline]

Definition at line 373 of file defaults.hpp.

{ x= y >> z; }
C mmx::rshift2 ( const C &  x,
const S &  y 
) [inline]

Definition at line 367 of file defaults.hpp.

Referenced by rshift2_op::op(), and rshift2_op::set_op().

{ return x >> y; }
C mmx::rshift2 ( const C &  x) [inline]

Definition at line 369 of file defaults.hpp.

{ return rshift2<C,int> (x, 1); }
void mmx::rshift2_assign ( C &  x,
const S &  y 
) [inline]

Definition at line 371 of file defaults.hpp.

Referenced by rshift2_op::set_op().

{ x >>= y; }
syntactic rshiftz ( const syntactic g,
const syntactic sh 
)

Definition at line 447 of file syntactic.cpp.

References syn().

                                                            {
  return syn ("rshiftz", g, sh); }
generic rshiftz ( const generic x1,
const generic x2 
)

Definition at line 835 of file generic.cpp.

References current_ev.

                                                       {
  return current_ev->apply ("rshiftz", x1, x2); }
void mmx::rshiftz ( C &  x,
const C &  y,
const S &  z 
) [inline]

Definition at line 390 of file defaults.hpp.

References lshiftz().

{ lshiftz (x, y, -z); }
C mmx::rshiftz ( const C &  x,
const S &  y 
) [inline]

Definition at line 384 of file defaults.hpp.

References lshiftz().

Referenced by sqrt_op::def(), quo_op::def(), div_op::def(), invert_op::def(), rshiftz_op::op(), and rshiftz_op::set_op().

{ return lshiftz (x, -y); }
C mmx::rshiftz ( const C &  x) [inline]

Definition at line 386 of file defaults.hpp.

{ return rshiftz<C,int> (x, 1); }
void mmx::rshiftz_assign ( C &  x,
const S &  y = 1 
) [inline]

Definition at line 388 of file defaults.hpp.

References lshiftz_assign().

Referenced by rshiftz_op::set_op().

{ lshiftz_assign (x, -y); }
void mmx::safe_free ( register void *  ptr) [inline]

Definition at line 126 of file fast_new.hpp.

                               {
  //printf ("Free : %p, %p\n", ptr,
  //        *((void**) ((void*) (((char*) ptr) - sizeof (void*)))));
  free (*((void**) ((void*) (((char*) ptr) - sizeof (void*)))));
}
void* mmx::safe_malloc ( register size_t  sz)
bool mmx::same_type ( const generic &  x1,
const generic &  x2 
) [inline]

Definition at line 184 of file generic.hpp.

Referenced by convert(), exact_eq(), and operator==().

                                                             {
  return x1->same_type (x2); }
bool save ( const string file_name,
const string s 
)

Definition at line 467 of file system.cpp.

References decode_name(), error_flag(), output_file_port(), and s.

                                                     {
  string file_name= decode_name (orig_file_name);
  port f= output_file_port (file_name);
  if (error_flag (f)) return true;
  f << s;
  return false;
}
nat mmx::scalar_to_alias ( nat  id) [inline]

Definition at line 196 of file alias.hpp.

References alias_type_info().

Referenced by object_alias(), and object_specialize_alias().

                         {
  int mode= 1;
  alias_type_info (id, mode);
  return id;
}
static void mmx::scheme_to_tm ( string s,
const generic g,
int  indent 
) [static]

Definition at line 519 of file mmx_texmacs.cpp.

References cdr(), compound_to_vector(), ends(), ERROR, is_func(), literal_to_string(), n, N(), spaces(), unquote(), and write().

Referenced by flatten_as_tm().

                                                       {
  //mmout << "Converting " << g << "\n";
  if (is<literal> (g))
    write (s, unquote (literal_to_string (g)));
  else if (is_func (g, "concat")) {
    for (nat i=1; i<N(g); i++)
      scheme_to_tm (s, g[i], indent);
  }
  else if (is_func (g, "document")) {
    for (nat i=1; i<N(g); i++) {
      if (i>1) {
        if (ends (s, "\n")) s << "\\;";
        s << "\n\n" << spaces (indent);
      }
      scheme_to_tm (s, g[i], indent);
    }
  }
  else if (is<compound> (g) && N(g) > 0 && is<literal> (g[0])) {
    string func= literal_to_string (g[0]);
    vector<generic> args= cdr (compound_to_vector (g));
    int i, last, n=N(args);
    for (i=n-1; i>=0; i--)
      if (is_func (args[i], "document"))
        break;
    last= i;
    if (last >= 0) {
      for (i=0; i<=n; i++) {
        bool flag= (i<n) && is_func (args[i], "document");
        if (i==0) s << "<\\" << func;
        else if (i==last+1) s << "</" << func;
        else if (is_func (args[i-1], "document")) s << "<|" << func;
        if (i==n) { s << ">"; break; }

        if (flag) {
          s << ">";
          if (!ends (s, "\n")) s << "\n" << spaces (indent + 2);
          scheme_to_tm (s, args[i], indent + 2);
          if (!ends (s, "\n")) s << "\n" << spaces (indent);
        }
        else {
          s << "|";
          scheme_to_tm (s, args[i], indent);
        }
      }
    }
    else {
      s << "<" << func;
      for (i=0; i<n; i++) {
        s << "|";
        scheme_to_tm (s, args[i], indent);
      }
      s << ">";
    }    
  }
  else ERROR ("invalid scheme markup");
}
int search_backwards ( const string s,
const string what,
const int &  pos 
)

Search first occurrence of @ in @ before @ or @-1@.

Definition at line 526 of file string.cpp.

References N(), and reads().

Referenced by GLUE_14().

                                                                       {
  for (int i= pos - N(what); i >= 0; i--)
    if (reads (s, i, what)) return i;
  return -1;
}
int search_forwards ( const string s,
const string what,
const int &  pos 
)

Search first occurrence of @ in @ after @ or @-1@.

Definition at line 519 of file string.cpp.

References N(), and reads().

Referenced by GLUE_13().

                                                                      {
  for (nat i= pos; i + N(what) <= N(s); i++)
    if (reads (s, i, what)) return i;
  return -1;
}
C2 mmx::second ( const triple< C1, C2, C3 > &  t) [inline]

Definition at line 41 of file triple.hpp.

{ return t.x2; }
C2 mmx::second ( const pair< C1, C2 > &  p) [inline]

Definition at line 38 of file pair.hpp.

Referenced by sort_leq().

{ return p.x2; }
const C * seg ( const vector< C, V > &  v) [inline]

Definition at line 207 of file vector.hpp.

{ return v->a; }
C * seg ( vector< C, V > &  v) [inline]
void select_evaluator ( const evaluator ev)

Definition at line 61 of file evaluator.cpp.

References cons(), current_ev, and stack_ev.

                                       {
  //assert (!ev_lock);
  //ev_lock= true;
  //{
  /*
    if (N(stack_ev) < 6)
    mmout << "[" << N (stack_ev)
    << ":" << inside (current_ev)
    << "+" << inside (ev)
    << "]" << flush_now;
  */
  stack_ev  = cons (current_ev, stack_ev);
  current_ev= ev;
  //}
  //ev_lock= false;
}
iterator<C> mmx::seq ( const C &  c1,
const C &  c2,
const C &  c3,
const C &  c4,
const C &  c5 
)

Definition at line 304 of file iterator.hpp.

References C, get_format(), and Iterator.

{
  C* a= mmx_new<C> (5);
  a[0]= c1; a[1]= c2; a[2]= c3; a[3]= c4; a[4]= c5;
  return Iterator (new finite_iterator_rep<C> (a, 5, get_format (c1)));
}
iterator<C> mmx::seq ( const C &  c1,
const C &  c2,
const C &  c3 
)

Definition at line 288 of file iterator.hpp.

References C, get_format(), and Iterator.

                                            {
  C* a= mmx_new<C> (3);
  a[0]= c1; a[1]= c2; a[2]= c3;
  return Iterator (new finite_iterator_rep<C> (a, 3, get_format (c1)));
}
iterator<C> mmx::seq ( const C &  c1,
const C &  c2 
)

Definition at line 281 of file iterator.hpp.

References C, get_format(), and Iterator.

                               {
  C* a= mmx_new<C> (2);
  a[0]= c1; a[1]= c2;
  return Iterator (new finite_iterator_rep<C> (a, 2, get_format (c1)));
}
iterator<C> mmx::seq ( const C &  c1,
const C &  c2,
const C &  c3,
const C &  c4,
const C &  c5,
const C &  c6 
)

Definition at line 313 of file iterator.hpp.

References C, get_format(), and Iterator.

{
  C* a= mmx_new<C> (6);
  a[0]= c1; a[1]= c2; a[2]= c3; a[3]= c4; a[4]= c5; a[5]= c6;
  return Iterator (new finite_iterator_rep<C> (a, 6, get_format (c1)));
}
iterator<C> mmx::seq ( const C &  c1)
Examples:
chain_test.cpp, iterator_test.cpp, list_test.cpp, table_test.cpp, and vector_test.cpp.

Definition at line 274 of file iterator.hpp.

References C, get_format(), and Iterator.

                  {
  C* a= mmx_new<C> (1);
  a[0]= c1;
  return Iterator (new finite_iterator_rep<C> (a, 1, get_format (c1)));
}
iterator<C> mmx::seq ( const C &  c1,
const C &  c2,
const C &  c3,
const C &  c4 
)

Definition at line 295 of file iterator.hpp.

References C, get_format(), and Iterator.

{
  C* a= mmx_new<C> (4);
  a[0]= c1; a[1]= c2; a[2]= c3; a[3]= c4;
  return Iterator (new finite_iterator_rep<C> (a, 4, get_format (c1)));
}
static void mmx::serialize ( string s,
const generic g 
) [static]

Definition at line 172 of file mmx_printer.cpp.

References as_string(), contains(), GEN_MINUS, GEN_PLUS, INDENT, is_func(), LF, literal_to_string(), mmx_symbol_table(), N(), starts(), texmacs_expand(), UNINDENT, and VARINDENT.

Referenced by as_mmx(), and serialize().

                                        {
  if (is<literal> (g)) {
    static table<generic,generic> t= mmx_symbol_table ();
    if (contains (t, g)) s << literal_to_string (t[g]);
    else if (g == "$spc") s << " ";
    else if (g == "$lf") s << LF;
    else if (g == "$cr");
    else s << literal_to_string (g);
  }
  else if (is_func (g, "$concat") ||
           is_func (g, "$bracket") ||
           is_func (g, "$prefix") ||
           is_func (g, "$postfix"))
    for (nat i=1; i<N(g); i++)
      serialize (s, g[i]);
  else if (is_func (g, "$infix", 3)) {
    serialize (s, g[1]);
    if (g[2] != "^" && g[2] != "^^") s << " ";
    serialize (s, g[2]);
    if (g[2] != "^" && g[2] != "^^") s << " ";
    serialize (s, g[3]); 
  }
  else if (is_func (g, "$bigop") && N(g) >= 3) {
    if (g[1] == GEN_PLUS && is_func (g[2], GEN_MINUS, 1)) {
      s << "-";
      serialize (s, g[2][1]);
    }
    else serialize (s, g[2]);
    for (nat i=3; i<N(g); i++) {
      if (g[1] == GEN_PLUS && is_func (g[i], GEN_MINUS, 1)) {
        s << " " << "-" << " ";
        serialize (s, g[i][1]);
      }
      else {
        s << " ";
        serialize (s, g[1]);
        s << " ";
        serialize (s, g[i]);
      }
    }
  }
  else if (is_func (g, "$keyword", 1))
    serialize (s, g[1]);
  else if (is_func (g, "$operate", 2) ||
           is_func (g, "$keyword", 2)) {
    serialize (s, g[1]);
    s << " ";
    serialize (s, g[2]);
  }
  else if (is_func (g, "$hlist") ||
           is_func (g, "$vlist")) {
    if (N(g) == 1) return;
    serialize (s, g[1]);
    for (nat i=2; i<N(g); i++) {
      if (g[0] == "$hlist") s << ", ";
      else s << "; ";
      serialize (s, g[i]);
    }
  }
  else if (is_func (g, "$indent")) {
    s << INDENT;
    for (nat i=1; i<N(g); i++)
      serialize (s, g[i]);
    s << UNINDENT;
  }
  else if (is_func (g, "$varindent")) {
    serialize (s, g[1]);
    s << VARINDENT;
    for (nat i=2; i<N(g); i++)
      serialize (s, g[i]);
    s << UNINDENT;
  }
  else if (is_func (g, "$text", 1))
    serialize (s, g[1]);
  else if (is_func (g, "$math", 1))
    serialize (s, g[1]);
  else if (is_func (g, "$dynamic", 2)) {
    s << "< ";
    serialize (s, g[1]);
    s << " | ";
    serialize (s, g[2]);
    s << " >";
  }
  else if (is<compound> (g) && is<literal> (g[0]) &&
           starts (as_string (as<literal> (g[0])), "tm$")) {
    generic h= texmacs_expand (g);
    serialize (s, h);
  }
  else {
    serialize (s, g[0]);
    s << " (";
    for (nat i=1; i<N(g); i++) {
      if (i != 1) s << ", ";
      serialize (s, g[i]);
    }
    s << ")";
  }
}
static string mmx::serialize ( const generic g) [static]

Definition at line 272 of file mmx_printer.cpp.

References s, and serialize().

                             {
  string s;
  serialize (s, g);
  return s;
}
void set_accuracy ( double &  x) [inline]

Definition at line 33 of file double.hpp.

Referenced by accuracy_cst(), and accuracy_as_op::set_op().

{ x= __DBL_EPSILON__; }
void mmx::set_accuracy ( vector< C, V > &  v)

Definition at line 961 of file vector.hpp.

{ nullary_set<accuracy_as_op> (v); }
void set_accuracy ( generic x)

Definition at line 250 of file generic.cpp.

References GEN_ACCURACY.

{ x= GEN_ACCURACY; }
void set_accuracy ( syntactic x)

Definition at line 103 of file syntactic.cpp.

References as_syntactic(), and GEN_ACCURACY.

generic set_alias ( const generic a,
const generic val 
)

Definition at line 89 of file alias.cpp.

References alias_setter(), type(), and val.

                                                 {
  routine r;
  alias_setter (type (a), r);
  return r->apply (a, val);
}
C mmx::set_alias ( const alias< C > &  a,
const C &  c 
) [inline]

Definition at line 59 of file alias.hpp.

Referenced by object_set_alias(), and set_genalias().

                                                     {
  a->open ()= c; a->close (); return c; }
void mmx::set_as ( generic &  r,
const C &  x 
) [inline]
void mmx::set_as ( vector< C, V > &  r,
const T &  x 
) [inline]

Definition at line 266 of file vector.hpp.

References CF(), and Vector.

                               {
  r= Vector (x, CF(r));
}
void mmx::set_as ( iterator< T > &  r,
const iterator< F > &  x 
) [inline]

Definition at line 221 of file iterator.hpp.

References CF().

                                              {
  r= iterator<T> (new as_iterator_rep<T,F> (x, CF(r)));
}
void mmx::set_as ( generic &  r,
const generic &  x 
) [inline]

Definition at line 573 of file generic.hpp.

                                      {
 r= x;
}
void mmx::set_as ( list< T > &  r,
const vector< F > &  l 
) [inline]

Definition at line 169 of file list.hpp.

References car(), cdr(), CF(), cons(), is_nil(), s, set_as(), and T.

                                        {
  if (is_nil (l)) r= list<T> (CF(r));
  else {
    T c; set_as (c, car (l));
    list<T> s (CF (r)); set_as (s, cdr (l));
    r= cons (c, s);
  }
}
void mmx::set_as ( C &  r,
const generic &  x 
) [inline]

Definition at line 568 of file generic.hpp.

                                {
  r= ((generic_concrete_rep<C>*) inspect(x)) -> rep;
}
void mmx::set_as ( list< C > &  r,
const T &  x 
) [inline]

Definition at line 179 of file list.hpp.

References set_as(), and T.

                             {
  T c; set_as (c, x);
  r= list<T> (c);
}
void mmx::set_as ( vector< T, TV > &  r,
const vector< F, FV > &  v 
) [inline]

Definition at line 261 of file vector.hpp.

References CF().

                                                {
  r= vector<T,TV> (v, CF(r));
}
void mmx::set_as ( T &  r,
const F &  x 
) [inline]

Definition at line 624 of file type_props.hpp.

                          {
  r= as_helper<T,F>::cv (x);
}
void set_catalan ( generic x)

Definition at line 254 of file generic.cpp.

References GEN_CATALAN.

Referenced by catalan_cst(), and catalan_as_op::set_op().

{ x= GEN_CATALAN; }
void set_catalan ( syntactic x)

Definition at line 107 of file syntactic.cpp.

References as_syntactic(), and GEN_CATALAN.

void mmx::set_catalan ( vector< C, V > &  v)

Definition at line 955 of file vector.hpp.

{ nullary_set<catalan_as_op> (v); }
int mmx::set_env ( const string var,
const string value 
)
void set_euler ( syntactic x)

Definition at line 106 of file syntactic.cpp.

References as_syntactic(), and GEN_EULER.

void set_euler ( double &  x) [inline]

Definition at line 36 of file double.hpp.

Referenced by euler_cst(), and euler_as_op::set_op().

{ x= 0.5772156649015328606065120900824024L; }
void set_euler ( generic x)

Definition at line 253 of file generic.cpp.

References GEN_EULER.

{ x= GEN_EULER; }
void mmx::set_euler ( vector< C, V > &  v)

Definition at line 954 of file vector.hpp.

{ nullary_set<euler_as_op> (v); }
void mmx::set_false ( T &  x) [inline]
bool set_frac_flag ( bool  new_val)

Definition at line 244 of file syntactic.cpp.

References frac_flag.

Referenced by ordered_product().

                             {
  bool ret= frac_flag;
  frac_flag= new_val;
  return ret;
}
void set_fuzz ( syntactic x)

Definition at line 110 of file syntactic.cpp.

References as_syntactic(), and GEN_FUZZ.

void set_fuzz ( generic x)

Definition at line 257 of file generic.cpp.

References GEN_FUZZ.

{ x= GEN_FUZZ; }
void mmx::set_fuzz ( vector< C, V > &  v)

Definition at line 958 of file vector.hpp.

{ nullary_set<fuzz_as_op> (v); }
void set_fuzz ( double &  x) [inline]

Definition at line 30 of file double.hpp.

Referenced by fuzz_cst(), and fuzz_as_op::set_op().

{ x= 0.0; }
generic mmx::set_genalias ( const generic_alias< C > &  a,
const generic c 
) [inline]

Definition at line 136 of file alias.hpp.

References set_alias().

Referenced by WRAP_WRAPPED_IMPL().

                                                                            {
  return set_alias (*a, c); }
void set_imaginary ( generic x)

Definition at line 255 of file generic.cpp.

References GEN_I.

Referenced by imaginary_cst(), and imaginary_as_op::set_op().

{ x= GEN_I; }
void set_imaginary ( syntactic x)

Definition at line 108 of file syntactic.cpp.

References as_syntactic(), and GEN_I.

{ x= as_syntactic (GEN_I); }
void mmx::set_imaginary ( vector< C, V > &  v)

Definition at line 956 of file vector.hpp.

{ nullary_set<imaginary_as_op> (v); }
void set_infinity ( syntactic x)

Definition at line 111 of file syntactic.cpp.

References as_syntactic(), and GEN_INFINITY.

void set_infinity ( generic x)

Definition at line 258 of file generic.cpp.

References GEN_INFINITY.

{ x= GEN_INFINITY; }
void set_infinity ( double &  x) [inline]

Definition at line 29 of file double.hpp.

Referenced by infinity_cst(), and infinity_as_op::set_op().

{ x= HUGE_VAL; }
void mmx::set_infinity ( T &  x) [inline]

Definition at line 731 of file type_props.hpp.

References promote(), and times_infinity().

                                                     {
  x= times_infinity (promote (1, x)); }
void mmx::set_infinity ( vector< C, V > &  v)

Definition at line 962 of file vector.hpp.

{ nullary_set<infinity_as_op> (v); }
void set_largest ( syntactic x)

Definition at line 102 of file syntactic.cpp.

References as_syntactic(), and GEN_LARGEST.

void set_largest ( generic x)

Definition at line 249 of file generic.cpp.

References GEN_LARGEST.

{ x= GEN_LARGEST; }
void set_largest ( double &  x) [inline]

Definition at line 32 of file double.hpp.

Referenced by largest_cst(), and largest_as_op::set_op().

{ x= nextafter (HUGE_VAL, 0.0); }
void mmx::set_largest ( vector< C, V > &  v)

Definition at line 960 of file vector.hpp.

{ nullary_set<largest_as_op> (v); }
void set_log2 ( generic x)

Definition at line 252 of file generic.cpp.

References log().

{ x= log (generic (2)); }
void set_log2 ( double &  x) [inline]

Definition at line 34 of file double.hpp.

Referenced by log2_cst(), and log2_as_op::set_op().

{ x= 0.6931471805599453094172321214581766L; }
void set_log2 ( syntactic x)

Definition at line 105 of file syntactic.cpp.

References as_syntactic(), and log().

{ x= log (as_syntactic (2)); }
void mmx::set_log2 ( vector< C, V > &  v)

Definition at line 953 of file vector.hpp.

{ nullary_set<log2_as_op> (v); }
void set_maximal ( double &  x) [inline]

Definition at line 27 of file double.hpp.

{ x= HUGE_VAL; }
void set_maximal ( long int &  x) [inline]

Definition at line 27 of file int.hpp.

                                      {
  x= (long int) (((long unsigned int) (-1)) >> 1); }
void set_maximal ( long unsigned int &  x) [inline]

Definition at line 31 of file int.hpp.

                                               {
  x= (long unsigned int) (-1); }
void set_maximal ( int &  x) [inline]

Definition at line 19 of file int.hpp.

Referenced by maximal_cst(), inf_op::set_neutral(), min_op::set_neutral(), and maximal_as_op::set_op().

                                 {
  x= (int) (((nat) (-1)) >> 1); }
void set_maximal ( nat &  x) [inline]

Definition at line 23 of file int.hpp.

                                 {
  x= (nat) (-1); }
void mmx::set_maximal ( vector< C, V > &  v)

Definition at line 963 of file vector.hpp.

{ nullary_set<maximal_as_op> (v); }
void set_maximal ( syntactic x)

Definition at line 112 of file syntactic.cpp.

References as_syntactic(), and GEN_INFINITY.

void set_maximal ( generic x)

Definition at line 259 of file generic.cpp.

References GEN_INFINITY.

{ x= GEN_INFINITY; }
void mmx::set_minimal ( vector< C, V > &  v)

Definition at line 964 of file vector.hpp.

{ nullary_set<minimal_as_op> (v); }
void set_minimal ( int &  x) [inline]
void set_minimal ( syntactic x)

Definition at line 113 of file syntactic.cpp.

References as_syntactic(), and GEN_INFINITY.

void set_minimal ( double &  x) [inline]

Definition at line 28 of file double.hpp.

{ x= -HUGE_VAL; }
void set_minimal ( generic x)

Definition at line 260 of file generic.cpp.

References GEN_INFINITY.

{ x= -GEN_INFINITY; }
void set_minimal ( nat &  x) [inline]

Definition at line 25 of file int.hpp.

                                 {
  x= (nat) 0; }
void set_minimal ( long int &  x) [inline]

Definition at line 29 of file int.hpp.

                                      {
  x= (long int) ((((long unsigned int) (-1)) >> 1) + 1); }
void set_minimal ( long unsigned int &  x) [inline]

Definition at line 33 of file int.hpp.

                                               {
  x= (long unsigned int) 0; }
void set_nan ( syntactic x)

Definition at line 109 of file syntactic.cpp.

References as_syntactic(), and GEN_NAN.

void mmx::set_nan ( T &  x) [inline]

Definition at line 729 of file type_props.hpp.

References promote().

                                                {
  x= promote (1, x) / promote (0, x); }
void set_nan ( double &  x) [inline]

Definition at line 26 of file double.hpp.

Referenced by nan_cst(), and nan_as_op::set_op().

{ x= NAN; }
void set_nan ( generic x)

Definition at line 256 of file generic.cpp.

References GEN_NAN.

{ x= GEN_NAN; }
void mmx::set_nan ( vector< C, V > &  v)

Definition at line 957 of file vector.hpp.

{ nullary_set<nan_as_op> (v); }
void mmx::set_one ( T &  x) [inline]

Definition at line 723 of file type_props.hpp.

References set_as().

Referenced by lcm_op::set_neutral(), and mul_op::set_neutral().

{ set_as (x, (int) 1); }
void set_pi ( syntactic x)

Definition at line 104 of file syntactic.cpp.

References as_syntactic(), and GEN_PI.

{ x= as_syntactic (GEN_PI); }
void set_pi ( generic x)

Definition at line 251 of file generic.cpp.

References GEN_PI.

{ x= GEN_PI; }
void mmx::set_pi ( T &  x) [inline]

Definition at line 727 of file type_props.hpp.

References atan(), and promote().

                                               {
  x= promote (4, x) * atan (promote (1, x)); }
void set_pi ( double &  x) [inline]

Definition at line 35 of file double.hpp.

Referenced by pi_cst(), and pi_as_op::set_op().

{ x= 3.1415926535897932384626433832795029L; }
void mmx::set_pi ( vector< C, V > &  v)

Definition at line 952 of file vector.hpp.

{ nullary_set<pi_as_op> (v); }
void set_smallest ( double &  x) [inline]

Definition at line 31 of file double.hpp.

Referenced by smallest_as_op::set_op(), and smallest_cst().

{ x= nextafter (0.0, HUGE_VAL); }
void mmx::set_smallest ( vector< C, V > &  v)

Definition at line 959 of file vector.hpp.

{ nullary_set<smallest_as_op> (v); }
void set_smallest ( syntactic x)

Definition at line 101 of file syntactic.cpp.

References as_syntactic(), and GEN_SMALLEST.

void set_smallest ( generic x)

Definition at line 248 of file generic.cpp.

References GEN_SMALLEST.

{ x= GEN_SMALLEST; }
void set_top ( heap< C > &  h,
const C &  x 
) [inline]
Examples:
heap_test.cpp.

Definition at line 185 of file heap.hpp.

                                               {
  h.secure(); h.rep->Set_top (x); }
void mmx::set_true ( T &  x) [inline]

Definition at line 724 of file type_props.hpp.

References set_as().

Referenced by and_is_finite_op::set_neutral(), and and_op::set_neutral().

{ set_as (x, true); }
void mmx::set_zero ( T &  x) [inline]

Definition at line 722 of file type_props.hpp.

References set_as().

Referenced by gcd_op::set_neutral(), mul_sub_op::set_neutral(), mul_add_op::set_neutral(), and add_op::set_neutral().

{ set_as (x, (int) 0); }
generic sharpen ( const generic x1)

Definition at line 824 of file generic.cpp.

References current_ev.

                                    {
  return current_ev->apply ("sharpen", x1); }
C mmx::sharpen ( const C &  x) [inline]

Definition at line 703 of file defaults.hpp.

Referenced by sharpen_op::op(), and sharpen_op::set_op().

                                                   {
  return x; }
table<C,T,V> mmx::sharpen ( const table< C, T, V > &  t) [inline]

Definition at line 714 of file table.hpp.

                                           {
  return unary_map<sharpen_op> (t); }
vector<C,V> mmx::sharpen ( const vector< C, V > &  v) [inline]

Definition at line 1166 of file vector.hpp.

                                             {
  return unary_map<sharpen_op> (v); }
chain<C> chain<C> mmx::shift_left ( const chain< C > &  c)

Definition at line 246 of file chain.hpp.

References Chain, left(), middle(), and right().

Referenced by balance_left().

                            {
  return Chain (Chain (left (c), middle (c), left (right (c))),
                middle (right (c)),
                right (right (c)));
}
chain<C> mmx::shift_right ( const chain< C > &  c)

Definition at line 253 of file chain.hpp.

References Chain, left(), middle(), and right().

Referenced by balance_right().

                             {
  return Chain (left (left (c)),
                middle (left (c)),
                Chain (right (left (c)), middle (c), right (c)));
}
void mmx::show_symbol_entries ( )

Definition at line 128 of file symbol.hpp.

int mmx::sign ( const unsigned char &  x) [inline]

Definition at line 469 of file defaults.hpp.

{ return (x == 0) ? 0 : 1; }     
int mmx::sign ( const long long unsigned int &  x) [inline]

Definition at line 481 of file defaults.hpp.

{ return (x == 0) ? 0 : 1; }
int mmx::sign ( const short unsigned int &  x) [inline]

Definition at line 472 of file defaults.hpp.

{ return (x == 0) ? 0 : 1; }     
int mmx::sign ( const long unsigned int &  x) [inline]

Definition at line 478 of file defaults.hpp.

{ return (x == 0) ? 0 : 1; }     
int mmx::sign ( const C &  x) [inline]

Definition at line 462 of file defaults.hpp.

Referenced by atan2(), compare(), sign_op::op(), and sign_op::set_op().

                  {
  if (x>0) return 1;
  if (x<0) return -1;
  return 0;
}
int mmx::sign ( const unsigned int &  x) [inline]

Definition at line 475 of file defaults.hpp.

{ return (x == 0) ? 0 : 1; }     
static void mmx::signed_decompose ( const syntactic g,
syntactic abs_g,
int &  sgn_g 
) [static]

Definition at line 120 of file syntactic.cpp.

References as_string(), GEN_MINUS, GEN_OVER, GEN_TIMES, is_atom(), is_func(), N(), and s.

Referenced by migrate_negate(), migrate_sub(), operator+(), operator-(), and pow().

                                                                    {
  if (is_atom (g)) {
    const string s= as_string (g);
    if (N(s) > 1 && s[0] == '-' &&
        (s[1] == '.' || (s[1] >= '0' && s[1] <= '9'))) {
      abs_g= syntactic (s (1, N(s)));
      sgn_g= -1;
    }
    else {
      abs_g= g;
      sgn_g= 1;
    }
  }
  else if (is_func (g, GEN_MINUS, 1)) {
    signed_decompose (g[1], abs_g, sgn_g);
    sgn_g= -sgn_g;
  }
  else if (is_func (g, GEN_TIMES, 2) || is_func (g, GEN_OVER, 2)) {
    syntactic a1, a2;
    int     s1, s2;
    signed_decompose (g[1], a1, s1);
    signed_decompose (g[2], a2, s2);
    if (is_func (g, GEN_TIMES, 2)) abs_g= a1 * a2;
    else abs_g= a1 / a2;
    sgn_g= s1 * s2;
  }
  else {
    abs_g= g;
    sgn_g= 1;
  }
}
void simplify ( table< C, T, V > &  t) [inline]

Definition at line 171 of file table.hpp.

Referenced by append(), binary_combine(), binary_map(), binary_map_scalar(), map(), REP_STRUCT_2(), unary_map(), and unary_set_scalar().

                                     {
  t.secure(); t.rep->simplify (); }
syntactic sin ( const syntactic g)

Definition at line 405 of file syntactic.cpp.

References GEN_SIN, and syn().

{ return syn (GEN_SIN, g); }
generic sin ( const generic x1)

Definition at line 450 of file generic.cpp.

References ACC_SIN, ACC_UNARY, current_ev, and GEN_SIN.

                        {
  ACC_UNARY (ACC_SIN, x1);
  return current_ev->apply (GEN_SIN, x1);
}
double sin ( const double &  x) [inline]

Definition at line 49 of file double.hpp.

Referenced by cos_sin(), cos_op::diff_op(), GLUE_38(), sin_op::op(), trig_op::op(), sin_op::op_init(), sin_op::set_op(), and trig().

{ return std::sin (x); }
vector<C,V> mmx::sin ( const vector< C, V > &  v)

Definition at line 1086 of file vector.hpp.

{ return unary_map<sin_op> (v); }
generic sinh ( const generic x1)

Definition at line 486 of file generic.cpp.

References ACC_SINH, ACC_UNARY, and exp().

                         {
  ACC_UNARY (ACC_SINH, x1);
  return (exp (x1) - exp (-x1)) / 2;
}
C mmx::sinh ( const C &  x) [inline]

Definition at line 589 of file defaults.hpp.

References exp(), and promote().

Referenced by cosh_op::diff_op(), sinh_op::op(), sinh_op::op_init(), sinh_op::set_op(), and sinh().

                                                {
  return (exp (x) - exp (-x)) / promote (2, x); }
syntactic sinh ( const syntactic g)

Definition at line 411 of file syntactic.cpp.

References GEN_SH, and syn().

{ return syn (GEN_SH, g); }
double sinh ( const double &  x) [inline]

Definition at line 52 of file double.hpp.

References sinh().

{ return std::sinh (x); }
nat size ( const generic g)

Definition at line 89 of file generic_utils.cpp.

References N(), n, and var_flatten().

Referenced by compare_sub(), and REP_STRUCT_2().

                        {
  if (is<literal> (g)) return 1;
  if (is<compound> (g)) {
    nat i, n= N (g), sum= 1;
    for (i=0; i<n; i++)
      sum += size (g[i]);
    return sum;
  }
  return size (var_flatten (g));
}
C mmx::skew_div ( const C &  x,
const C &  y,
bool  left = false 
) [inline]

Definition at line 345 of file defaults.hpp.

References left().

                                                    {
  (void) left; return x / y; }
C mmx::skew_quo ( const C &  x,
const C &  y,
bool  left = false 
) [inline]

Definition at line 348 of file defaults.hpp.

References left(), and quo().

                                                    {
  (void) left; return quo (x, y); }
C mmx::skew_rem ( const C &  x,
const C &  y,
bool  left = false 
) [inline]

Definition at line 351 of file defaults.hpp.

References left(), and rem().

                                                    {
  (void) left; return rem (x, y); }
format<T> mmx::slow ( const format< typename fast_helper< T >::fast_type > &  fm) [inline]

Definition at line 709 of file type_props.hpp.

References get_format(), and get_sample().

                                       {
  return get_format (slow<T> (get_sample (fm)));
}
T mmx::slow ( const typename fast_helper< T >::fast_type &  x)

Definition at line 694 of file type_props.hpp.

Referenced by slow_op::op().

                             {
  return fast_helper<T>::uu (x);
}
format<T> mmx::slow_as ( const format< F > &  fm) [inline]

Definition at line 714 of file type_props.hpp.

References get_format(), and get_sample().

                              {
  return get_format (slow_as<T,F> (get_sample (fm)));
}
T mmx::slow_as ( const F &  x)

Definition at line 699 of file type_props.hpp.

                     {
  return fast_helper<T>::uu (x);
}
int small_big_compare ( const generic g1,
const generic g2 
)

Definition at line 181 of file generic_utils.cpp.

References compare().

Referenced by product_less_op::op().

                                                         {
  return compare (g1, g2, 1);
}
C mmx::smallest_cst ( ) [inline]

Definition at line 749 of file type_props.hpp.

References C, and set_smallest().

{ C r; set_smallest (r); return r; }
port socket_client_port ( const string host,
int  port 
)

Definition at line 146 of file socket_port.cpp.

References as_charp(), as_string(), error_port(), free_charp(), and socket_port().

Referenced by GLUE_5().

                                                 {
  // getting host
  char* _host= as_charp (host);
  struct hostent *hp = gethostbyname (_host);
  free_charp (_host);
  if (hp == NULL) return error_port ("no connection for '" * host * "'");

  // creating socket
  int fd= socket (AF_INET, SOCK_STREAM, 0);
  if (fd < 0) return error_port ("socket could not be created");

  // connecting to socket
  struct sockaddr_in insock;
  string where= host * ":" * as_string (pnr);
  memset ((char*) &insock, 0, sizeof (insock));
  insock.sin_family = AF_INET;
  insock.sin_port = htons ((unsigned short) pnr);
  memcpy ((char*) &insock.sin_addr, hp->h_addr, hp->h_length);
  if (connect (fd, (struct sockaddr*) &insock, sizeof (insock)) < 0)
    return error_port ("refused connection to '" * where * "'");

  // testing whether it works
  int flags = O_NONBLOCK;
  if (fcntl (fd, F_SETFL, flags) < 0)
    return error_port ("non working connection to '" * where * "'");
  return socket_port (host, pnr, 2, fd);
}
port mmx::socket_port ( const string host,
int  pnr,
int  role,
int  fd 
)

Definition at line 84 of file socket_port.cpp.

Referenced by socket_port_rep::accept(), socket_client_port(), and socket_server_port().

                                                            {
  return (port_rep*) new socket_port_rep (host, pnr, role, fd);
}
port socket_server_port ( const string host,
int  port 
)

Definition at line 93 of file socket_port.cpp.

References error_port(), and socket_port().

Referenced by GLUE_4().

                                                 {
  // get the server
  int fd;
  if ((fd = socket (PF_INET, SOCK_STREAM, 0)) == -1)
    return error_port ("call to 'socket' failed");

  // lose the pesky "address already in use" error message
  int yes= 1;
  if (setsockopt (fd, SOL_SOCKET, SO_REUSEADDR,
                  &yes, sizeof (int)) == -1)
    return error_port ("call to 'setsockopt' failed");

  // bind
  struct sockaddr_in local_address;
  local_address.sin_family = AF_INET;
  local_address.sin_addr.s_addr = INADDR_ANY;
  local_address.sin_port = htons (pnr);
  memset (local_address.sin_zero, '\0', sizeof local_address.sin_zero);
  if (bind (fd, (struct sockaddr *) &local_address,
            sizeof (local_address)) == -1)
    return error_port ("call to 'bind' failed");

  // listen
  if (::listen (fd, 10) == -1)
    return error_port ("call to 'listen' failed");
  return socket_port (host, pnr, 0, fd);
}
generic solve ( const generic x1,
const generic x2 
)

Definition at line 701 of file generic.cpp.

References current_ev, and GEN_SOLVE.

                                                     {
  return current_ev->apply (GEN_SOLVE, x1, x2); }
syntactic solve_lde_init ( const syntactic x,
const syntactic c 
)

Definition at line 478 of file syntactic.cpp.

References syn().

                                                                  {
  return syn ("solve_lde_init", x, c); }
generic solve_lde_init ( const generic x,
const generic c 
)

Definition at line 813 of file generic.cpp.

References current_ev.

Referenced by solve_matrix_lde_op::op_init(), and solve_vector_lde_op::op_init().

                                                              {
  return current_ev->apply ("solve_lde_init", x1, x2); }
void mmx::sort ( vector< T > &  v) [inline]

Definition at line 49 of file vector_sort.hpp.

                    {
  sort_leq<less_op> (v);
}
list<C> mmx::sort ( const list< C > &  l,
int(*)(const C &, const C &)  cmp 
)

Sort l increasingly wrt to cmp. cmp (x, y) < 0 iff x < y, cmp (x, y) = 0 iff x = y, cmp (x, y) > 0 iff x > y.

Definition at line 54 of file list_sort.hpp.

References List, merge(), N(), n, and split().

Referenced by list_sort(), load_directory(), and vector_sort().

                                                      {
  nat n= N(l);
  if (n <= 1) return l;
  List head, tail;
  split (l, n>>1, head, tail);
  head= sort (head, cmp);
  tail= sort (tail, cmp);
  return merge (head, tail, cmp);
}
void mmx::sort ( vector< T > &  v,
vector< nat > &  sigma 
) [inline]

Definition at line 79 of file vector_sort.hpp.

                                        {
  sort_leq<less_op> (v, sigma);
}
void mmx::sort_leq ( vector< T > &  v)

Definition at line 43 of file vector_sort.hpp.

References CF(), and N().

                        {
  vector<T> merge_buf= fill<T> (N(v), CF(v)); 
  sort_sub<Op> (v, 0, N(v), merge_buf);
}
void mmx::sort_leq ( vector< T > &  v,
vector< nat > &  sigma 
)

Definition at line 68 of file vector_sort.hpp.

References CF(), first(), N(), Pair, second(), and T.

                                            {
  typedef pair<T,nat> Pair;
  vector<Pair> tmp_v (Pair(T(),0), N(v)), merge_buf (Pair(T(),0), N(v));
  for (nat i= 0; i < N(v); i++) tmp_v[i]= Pair (v[i], i);  
  sort_sub<sort_op_pair_wrapper<Op> > (tmp_v, 0, N(v), merge_buf);
  sigma= fill<nat> (N(v), CF(v));
  for (nat i= 0; i < N(v); i++) sigma[i]= second (tmp_v[i]);
  for (nat i= 0; i < N(v); i++) v[i]    = first  (tmp_v[i]);
}
static void mmx::sort_sub ( vector< T > &  a,
int  start,
int  end,
vector< T > &  merge_buf 
) [static]

Definition at line 20 of file vector_sort.hpp.

References middle(), and start.

                                                                  {
  if (end-start <= 1) return;
  if (end-start == 2) {
    if (!Op::op (a[start], a[start+1])) {
      merge_buf[start]= a[start];
      a[start]= a[start+1];
      a[start+1]= merge_buf[start];
    }
    return;
  }
  int middle= (start+end)>>1; 
  sort_sub<Op> (a, start, middle, merge_buf);
  sort_sub<Op> (a, middle, end, merge_buf);
  int i,j,k;
  for (i=start, j=middle, k=start; (i<middle) && (j<end); )
    if (Op::op (a[i], a[j])) merge_buf[k++]= a[i++];
    else                     merge_buf[k++]= a[j++];
  j=k;
  while (i!=middle) a[k++]= a[i++];
  for (i=start; i<j; i++) a[i]= merge_buf[i];
}
string source_begin ( const generic g)

Definition at line 217 of file source_track.cpp.

References as_string(), source_column(), source_exists(), source_file(), and source_line().

                                {
  if (!source_exists (g)) return "Unknown location";
  return source_file (g) * ":" *
         as_string (source_line (g, false)) * ":" *
         as_string (source_column (g, false));
}
int source_column ( const generic g,
const bool &  last 
)

Definition at line 209 of file source_track.cpp.

References source_location::begin, source_position::column, source_location::end, is_nil(), and source_locate().

Referenced by source_begin(), and source_end().

                                                   {
  source_location l= source_locate (g);
  if (is_nil (l)) return 0;
  else if (last) return l.end.column;
  else return l.begin.column;
}
void source_delete ( const generic g)

Definition at line 129 of file source_track.cpp.

References reset(), and source_locs().

Referenced by source_extend().

                                 {
  reset (source_locs (), g);
}
string source_end ( const generic g)

Definition at line 225 of file source_track.cpp.

References as_string(), source_column(), source_exists(), source_file(), and source_line().

                              {
  if (!source_exists (g)) return "Unknown location";
  return source_file (g) * ":" *
         as_string (source_line (g, true)) * ":" *
         as_string (source_column (g, true));
}
string source_error ( const string msg,
const generic where 
)

Definition at line 316 of file source_track.cpp.

References as_string(), source_location::begin, source_position::column, is_nil(), source_position::line, literal_to_string(), mmerr, s, source_file(), source_locate(), source_underlined(), and strip_directory().

Referenced by source_exception().

                                                   {
  mmerr << ">>> g= " << g << "\n";
  string s;
  source_location l= source_locate (g);
  if (is_nil (l) && is<literal> (g))
    s << "Inside " << literal_to_string (g) << ": ";
  else if (is_nil (l))
    s << "Unknown location: ";
  else
    s << strip_directory (source_file (g)) << ":"
      << as_string (l.begin.line + 1) << ":" 
      << as_string (l.begin.column + 1) << ": ";
  s << msg << "\n"
    << source_underlined (g);
  return s;
}
string source_exception ( const exception e)

Definition at line 341 of file source_track.cpp.

References backtrace(), backtrace_depth, has_trace(), literal_to_string(), N(), source_error(), and trace_bottom().

Referenced by backtrace().

                                      {
  generic g= as<generic> (e);
  if (has_trace (g))
    return backtrace (trace_bottom (g, backtrace_depth));
  else {
    generic err= *e;
    if (is<literal> (err[1]))
      return source_error (literal_to_string (err[1]), err[N(err)-1]);
    else return source_error ("unknown", err[N(err)-1]);
  }
}
bool source_exists ( const generic g)

Definition at line 187 of file source_track.cpp.

References is_nil(), and source_locate().

Referenced by source_begin(), and source_end().

                                 {
  return !is_nil (source_locate (g));
}
generic source_extend ( const generic g1,
const generic g2 
)

Definition at line 134 of file source_track.cpp.

References source_location::obj, source_delete(), source_insert(), and source_locate().

Referenced by source_extend().

                                                     {
  //mmout << "source extending " << g1 << " with " << g2 <<"\n";
  source_location l;
  source_locate (g1, l);
  source_locate (g2, l);
  source_delete (g1);
  source_delete (g2);
  l.obj = g1;
  source_insert (g1, l);
  return g1;
}
generic mmx::source_extend ( const generic &  g1,
const generic &  g2,
const generic &  g3 
) [inline]

Definition at line 146 of file source_track.hpp.

References source_extend().

                                                                        {
  return source_extend (source_extend (g1, g2), g3);
}
string source_file ( const generic g)

Definition at line 192 of file source_track.cpp.

References as_string(), source_location::file_name, source_location::input_number, is_nil(), and source_locate().

Referenced by source_begin(), source_end(), and source_error().

                               {
  source_location l= source_locate (g);
  if (is_nil (l)) return "";
  else if (l.file_name == "")
    return "input[" * as_string (l.input_number + 1) * "]";
  else return l.file_name;
}
void source_insert ( const generic g,
const source_location l 
)

Definition at line 124 of file source_track.cpp.

References source_locs().

Referenced by source_extend().

                                                           {
  source_locs () [g] = l;
}
int source_line ( const generic g,
const bool &  last 
)

Definition at line 201 of file source_track.cpp.

References source_location::begin, source_location::end, is_nil(), source_position::line, and source_locate().

Referenced by source_begin(), and source_end().

                                                 {
  source_location l= source_locate (g);
  if (is_nil (l)) return 0;
  else if (last) return l.end.line;
  else return l.begin.line;
}
void source_locate ( const generic g,
source_location l 
)

Definition at line 151 of file source_track.cpp.

References source_location::begin, contains(), source_location::end, source_location::file_name, source_location::input_number, is_nil(), max(), min(), N(), source_location::obj, read(), and source_locs().

Referenced by source_column(), source_error(), source_exists(), source_extend(), source_file(), source_line(), source_locate(), source_string(), source_string_unindented(), and source_underlined().

                                                     {
  // mmout << "source_locate: " << g << " @ " << inside (g) << "\n";
  source_location arg_l = l;
  if (source_locs () -> contains (g)) {
    source_location l1 = read (source_locs (), g);
    if (is_nil (l))
      l = l1;
    else 
      if (!is_nil (l1)) {
        l.obj = l1.obj;
        if (l.file_name == l1.file_name && l.input_number == l1.input_number) {
          l.begin = min (l.begin, l1.begin);
          l.end = max (l.end, l1.end);
        }
        // If the location is not 'connected', we leave l unchanged. 
      }
    return;
  }
  if (is<compound> (g))
    for (nat i=0; i<N(g); i++)
      source_locate (g[i], l);
  l.obj = g;
}
source_location source_locate ( const generic g)

Definition at line 176 of file source_track.cpp.

References source_locate().

                                 {
  source_location l;
  source_locate (g, l);
  return l;
}
string source_underlined ( const generic g)
static string mmx::spaces ( nat  indent) [static]

Definition at line 492 of file mmx_texmacs.cpp.

References indent, and s.

Referenced by scheme_to_tm().

                    {
  string s;
  for (nat i=0; i<indent; i++)
    s << " ";
  return s;
}
sparse_vector<C,T,V> mmx::sparse_mul_add ( const sparse_vector< C, T, V > &  v1,
const sparse_vector< C, T, V > &  v2,
const C &  x 
) [inline]

Definition at line 337 of file sparse_vector.hpp.

                                                                              {
  return _mul_add<mul_op> (v1, v2, x); }
generic specialize ( const generic x1,
const generic x2 
)

Definition at line 847 of file generic.cpp.

References current_ev.

                                                          {
  return current_ev->apply ("specialize", x1, x2); }
generic specialize_alias ( const generic a)

Definition at line 60 of file alias.cpp.

References alias_specializer(), as(), get_alias(), type(), and val.

                                    {
  generic val= get_alias (as<alias<generic> > (a));
  routine r;
  alias_specializer (type (val), r);
  return r->apply (a);
}
nat mmx::species_type ( const generic &  g) [inline]

Definition at line 154 of file generic.hpp.

Referenced by is_list(), is_table(), and is_vector().

                                           {
  return g->get_species_type (); }
void mmx::split ( const list< C > &  l,
nat  n,
list< C > &  head,
list< C > &  tail 
)

head := copy (l[0..n-1]), tail := copy (l[n..N (l)-1]).

Definition at line 27 of file list_sort.hpp.

References car(), cdr(), cons(), and List.

Referenced by sort().

                                                     {
  if (n == 0) {
    head= List ();
    tail= l;
  }
  else {
    split (cdr (l), n-1, head, tail);
    head= cons (car (l), head);
  }
}
generic sqrt ( const generic x1)

Definition at line 426 of file generic.cpp.

References ACC_SQRT, ACC_UNARY, current_ev, and GEN_SQRT.

                         {
  ACC_UNARY (ACC_SQRT, x1);
  return current_ev->apply (GEN_SQRT, x1);
}
syntactic sqrt ( const syntactic g)

Definition at line 401 of file syntactic.cpp.

References GEN_SQRT, and syn().

{ return syn (GEN_SQRT, g); }
double sqrt ( const double &  x) [inline]
vector<C,V> mmx::sqrt ( const vector< C, V > &  v)

Definition at line 1082 of file vector.hpp.

{ return unary_map<sqrt_op> (v); }
syntactic sqrt_init ( const syntactic x,
const syntactic c 
)

Definition at line 463 of file syntactic.cpp.

References syn().

                                                             {
  return syn ("sqrt_init", x, c); }
generic sqrt_init ( const generic x,
const generic c 
)

Definition at line 801 of file generic.cpp.

References current_ev.

Referenced by sqrt_op::op_init().

                                                         {
  return current_ev->apply ("sqrt_init", x1, x2); }
syntactic square ( const syntactic g)

Definition at line 279 of file syntactic.cpp.

References GEN_POWER, and syn().

                            {
  return syn (GEN_POWER, g, syntactic (2));
}
double square ( const double &  x) [inline]

Definition at line 122 of file double.hpp.

{ return x * x; }
generic square ( const generic x1)

Definition at line 369 of file generic.cpp.

References ACC_SQUARE, ACC_UNARY, current_ev, and GEN_TIMES.

                           {
  ACC_UNARY (ACC_SQUARE, x1);
  return current_ev->apply (GEN_TIMES, x1, x1);
}
bool starts ( const string s,
const string what 
)

Tell if s starts with what.

Definition at line 315 of file string.cpp.

References N(), and s.

Referenced by as_texmacs(), decode_name(), file_is_script(), GLUE_10(), serialize(), texmacs_expand(), texmacs_to_scheme(), and unquote().

                                             {
  return N(s) >= N(what) && s (0, N(what)) == what;
}
generic std_exception ( const string msg,
const generic a,
const generic w 
)

Definition at line 25 of file exception.cpp.

References flatten_as_mmx(), gen(), and GEN_EXCEPTION.

                                                                          {
  exception exc (gen (GEN_EXCEPTION, msg * flatten_as_mmx (a), where));
  return as<generic> (exc);
}
generic std_exception ( const string msg,
const generic where 
)

Definition at line 20 of file exception.cpp.

References exception, gen(), and GEN_EXCEPTION.

Referenced by type_mismatch(), and wrong_nr_args().

                                                        {
  return as<generic> (exception (gen (GEN_EXCEPTION, msg, where)));
}
void store_file_source ( const string file_name,
const string data 
)

Definition at line 66 of file source_track.cpp.

References file_sources, and tokenize().

                                                                {
  file_sources [file_name] = tokenize (data, "\n");
}
void store_interactive_number ( nat  n)

Definition at line 34 of file source_track.cpp.

References ASSERT, interactive_sources, N(), and range().

                                 {
  ASSERT (n <= N(interactive_sources), "input number out of range");
  interactive_sources= range (interactive_sources, 0, n);
}
void store_interactive_source ( const string data,
nat  n = get_interactive_number () 
)

Definition at line 45 of file source_track.cpp.

References ASSERT, get_interactive_number(), interactive_sources, n, and tokenize().

                                                     {
  ASSERT (n <= get_interactive_number (), "input number out of range");
  vector<string> v= tokenize (data, "\n");
  if (n == get_interactive_number ()) interactive_sources << v;
  else interactive_sources[n]= v;
}
string string_as_mmx ( const string s)

Definition at line 931 of file mmx_printer.cpp.

References s.

Referenced by operator<<().

                                {
  //if (math_mode) { ... }
  return s;
}
C mmx::string_as_numeric ( const string &  s)

Definition at line 193 of file string.hpp.

References C, s, and val.

                                    {
  C val;
  string_to_numeric<C> (s, val);
  return val;
}
void mmx::string_to_floating ( const string s,
C &  val,
const char *  fm 
) [inline]

Definition at line 201 of file string.cpp.

References inside(), max(), n, and N().

Referenced by string_to_numeric().

                                                             {
  nat n= max (N(s), (nat) 39);
  char buffer[40];
  strncpy (buffer, inside (s, 0), n);
  buffer [n]= '\0';
  sscanf (buffer, fm, &val);
}
STMPL void string_to_numeric ( const string s,
float &  val 
)

Definition at line 215 of file string.cpp.

References string_to_floating().

                                                         {
  string_to_floating (s, x, "%f"); }
STMPL void string_to_numeric ( const string s,
double &  val 
)

Definition at line 217 of file string.cpp.

References string_to_floating().

                                                          {
  string_to_floating (s, x, "%lf"); }
void mmx::string_to_numeric ( const string &  s,
C &  val 
)

Definition at line 163 of file string.hpp.

References N(), n, and val.

                                            {
  int i=0, n=N(s);
  val=0;
  if (n==0) return;
  if (s[0]=='-') i++;
  while (i<n) {
    if (s[i]<'0') break;
    if (s[i]>'9') break;
    val *= 10;
    val += (int) (s[i]-'0');
    i++;
  }
  if (s[0]=='-') val=-val;
}
STMPL void string_to_numeric ( const string s,
long double &  val 
)

Definition at line 219 of file string.cpp.

References string_to_floating().

                                                               {
  string_to_floating (s, x, "%Lf"); }
string strip_directory ( const string name)

Definition at line 250 of file system.cpp.

References N().

Referenced by source_error().

                                     {
  for (int i= N(name)-1; i>=0; i--)
    if (name[i]=='/')
      return name (i+1, N(name));
  return name;
}
string strip_extension ( const string name)

Definition at line 258 of file system.cpp.

References N().

                                     {
  for (int i= N(name)-1; i>=0; i--)
    if (name[i]=='.')
      return name (0, i);
    else if (name[i]=='/')
      return name;
  return name;
}
mmx::STYPE_TO_TYPE ( template< typename C, typename V >  ,
scalar_type  ,
vector< C, V >  ,
 
)
void mmx::sub ( R &  x,
const C1 &  y1,
const C2 &  y2 
) [inline]

Definition at line 54 of file operators.hpp.

Referenced by lsub_op::set_op(), rsub_op::set_op(), sub_op::set_op(), and source_string_unindented().

{ x= y1 - y2; }
T mmx::sub_operator ( const T &  x,
const T &  y 
)

Definition at line 30 of file operators.hpp.

{ return x-y; }
generic substitute ( const generic x1,
const generic x2 
)

Definition at line 695 of file generic.cpp.

References current_ev, and GEN_SUBSTITUTE.

                                                          {
  return current_ev->apply (GEN_SUBSTITUTE, x1, x2); }
C mmx::sup ( const C &  x,
const C &  y 
)

Definition at line 513 of file defaults.hpp.

References max().

Referenced by sup_op::op(), and sup_op::set_op().

{ return max (x, y); }
sparse_vector<C,T,V> mmx::sup ( const sparse_vector< C, T, V > &  t,
const sparse_vector< C, T, V > &  u 
) [inline]

Definition at line 267 of file sparse_vector.hpp.

                                                     {
  return binary_map<sup_op,C,T,V> (t, u); }
vector<C,V> mmx::sup ( const vector< C, V > &  v,
const vector< C, V > &  w 
)

Definition at line 1053 of file vector.hpp.

                                                   {
  return binary_map<sup_op> (v, w); }
table<C,T,V> mmx::sup ( const table< C, T, V > &  t,
const table< C, T, V > &  u 
) [inline]

Definition at line 633 of file table.hpp.

                                                       {
  return binary_map<sup_op,C,T,V> (t, u); }
void mmx::swap ( C &  x,
C &  y 
) [inline]

Definition at line 751 of file defaults.hpp.

References C.

                  {
  C temp= x;
  x= y;
  y= temp;
}
nat mmx::symbolic_type ( const generic &  g) [inline]

Definition at line 152 of file generic.hpp.

                                            {
  return g->get_symbolic_type (); }
syntactic mmx::syn ( const char *  f,
const syntactic &  a1 
) [inline]

Definition at line 108 of file syntactic.hpp.

References as_syntactic(), and gen().

                                                          {
  return as_syntactic (gen (generic (f), *a1)); }
syntactic mmx::syn ( const syntactic &  f,
const vector< syntactic > &  a 
) [inline]

Definition at line 102 of file syntactic.hpp.

References as_syntactic(), and gen().

                                                                      {
  const vector<generic>* ptr= (vector<generic>*) ((void*) (&a));
  return as_syntactic (gen (*f, *ptr)); }
syntactic mmx::syn ( const generic &  f,
const syntactic &  a1 
) [inline]

Definition at line 126 of file syntactic.hpp.

References as_syntactic(), and gen().

                                                             {
  return as_syntactic (gen (f, *a1)); }
syntactic mmx::syn ( const generic &  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3,
const syntactic &  a4 
) [inline]

Definition at line 134 of file syntactic.hpp.

References as_syntactic(), and gen().

                                                                {
  return as_syntactic (gen (f, *a1, *a2, *a3, *a4)); }
syntactic mmx::syn ( const generic &  f) [inline]

Definition at line 124 of file syntactic.hpp.

References as_syntactic(), and gen().

                                        {
  return as_syntactic (gen (f)); }
syntactic mmx::syn ( const generic &  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3 
) [inline]

Definition at line 131 of file syntactic.hpp.

References as_syntactic(), and gen().

                                                                {
  return as_syntactic (gen (f, *a1, *a2, *a3)); }
syntactic mmx::syn ( const char *  f) [inline]

Definition at line 106 of file syntactic.hpp.

References as_syntactic(), and gen().

                                     {
  return as_syntactic (gen (generic (f))); }
syntactic mmx::syn ( const syntactic &  f,
const syntactic &  a1 
) [inline]

Definition at line 90 of file syntactic.hpp.

References as_syntactic(), and gen().

                                                               {
  return as_syntactic (gen (*f, *a1)); }
syntactic mmx::syn ( const generic &  f,
const vector< syntactic > &  a 
) [inline]

Definition at line 138 of file syntactic.hpp.

References as_syntactic(), and gen().

                                                                    {
  const vector<generic>* ptr= (vector<generic>*) ((void*) (&a));
  return as_syntactic (gen (f, *ptr)); }
syntactic mmx::syn ( const syntactic &  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3 
) [inline]

Definition at line 95 of file syntactic.hpp.

References as_syntactic(), and gen().

                                                                {
  return as_syntactic (gen (*f, *a1, *a2, *a3)); }
syntactic mmx::syn ( const char *  f,
const syntactic &  a1,
const syntactic &  a2 
) [inline]

Definition at line 110 of file syntactic.hpp.

References as_syntactic(), and gen().

                                           {
  return as_syntactic (gen (generic (f), *a1, *a2)); }
syntactic mmx::syn ( const char *  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3 
) [inline]

Definition at line 113 of file syntactic.hpp.

References as_syntactic(), and gen().

                                                                {
  return as_syntactic (gen (generic (f), *a1, *a2, *a3)); }
syntactic mmx::syn ( const char *  f,
const vector< syntactic > &  a 
) [inline]

Definition at line 120 of file syntactic.hpp.

References as_syntactic(), and gen().

                                                                 {
  const vector<generic>* ptr= (vector<generic>*) ((void*) (&a));
  return as_syntactic (gen (generic (f), *ptr)); }
syntactic mmx::syn ( const char *  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3,
const syntactic &  a4 
) [inline]

Definition at line 116 of file syntactic.hpp.

References as_syntactic(), and gen().

                                                                {
  return as_syntactic (gen (generic (f), *a1, *a2, *a3, *a4)); }
syntactic mmx::syn ( const generic &  f,
const syntactic &  a1,
const syntactic &  a2 
) [inline]

Definition at line 128 of file syntactic.hpp.

References as_syntactic(), and gen().

                                           {
  return as_syntactic (gen (f, *a1, *a2)); }
syntactic mmx::syn ( const syntactic &  f,
const syntactic &  a1,
const syntactic &  a2,
const syntactic &  a3,
const syntactic &  a4 
) [inline]

Definition at line 98 of file syntactic.hpp.

References as_syntactic(), and gen().

                                                                {
  return as_syntactic (gen (*f, *a1, *a2, *a3, *a4)); }
syntactic mmx::syn ( const syntactic &  f,
const syntactic &  a1,
const syntactic &  a2 
) [inline]

Definition at line 92 of file syntactic.hpp.

References as_syntactic(), and gen().

                                           {
  return as_syntactic (gen (*f, *a1, *a2)); }
string sysconf_dir ( )

Definition at line 108 of file system.cpp.

References get_env(), and prefix_dir().

               {
  string dir= get_env ("MMX_SYSCONF_DIR");
  if (dir == "") dir= prefix_dir () * "/etc";
  return dir;
}
int system ( const string s)

Definition at line 58 of file system.cpp.

References as_charp(), and free_charp().

Referenced by eval_system(), pipe_port(), and var_mkdir().

                         {
  //mmout << "Execute] " << s << "\n";
  char* _s= as_charp (s);
  int r= ::system (_s);
  free_charp (_s);
  return r;
}
double tan ( const double &  x) [inline]

Definition at line 50 of file double.hpp.

Referenced by GLUE_39(), tan_op::op(), tan_op::op_init(), and tan_op::set_op().

{ return std::tan (x); }
syntactic tan ( const syntactic g)

Definition at line 406 of file syntactic.cpp.

References GEN_TAN, and syn().

{ return syn (GEN_TAN, g); }
vector<C,V> mmx::tan ( const vector< C, V > &  v)

Definition at line 1087 of file vector.hpp.

{ return unary_map<tan_op> (v); }
generic tan ( const generic x1)

Definition at line 456 of file generic.cpp.

References ACC_TAN, ACC_UNARY, current_ev, and GEN_TAN.

                        {
  ACC_UNARY (ACC_TAN, x1);
  return current_ev->apply (GEN_TAN, x1);
}
syntactic tanh ( const syntactic g)

Definition at line 412 of file syntactic.cpp.

References GEN_TH, and syn().

{ return syn (GEN_TH, g); }
generic tanh ( const generic x1)

Definition at line 492 of file generic.cpp.

References ACC_TANH, ACC_UNARY, and exp().

                         {
  ACC_UNARY (ACC_TANH, x1);
  return (exp (x1) - exp (-x1)) / (exp (x1) + exp (-x1));
}
C mmx::tanh ( const C &  x) [inline]

Definition at line 591 of file defaults.hpp.

References exp().

Referenced by tanh_op::op(), tanh_op::op_init(), tanh_op::set_op(), and tanh().

                                                {
  return (exp (x) - exp (-x)) / (exp (x) + exp (-x)); }
double tanh ( const double &  x) [inline]

Definition at line 53 of file double.hpp.

References tanh().

{ return std::tanh (x); }
void mmx::term_threads ( )

Definition at line 223 of file threads.cpp.

{}
routine mmx::ternary_routine ( const generic name,
D(*)(const S1 &, const S2 &, const S3 &)  f 
)

Definition at line 315 of file routine.hpp.

Referenced by define().

                                                           {
  return new ternary_routine_rep<D,S1,S2,S3> (name, f);
}
static bool mmx::test_keyword ( const char *  k,
parse_instance obj 
) [static]

Definition at line 65 of file mmx_lexer.cpp.

References INC_POS, is_alpha(), n, pos, RESTORE_START, and s.

                                                  {
  RESTORE_START;
  while ((*k)!='\0') {
    if (pos>=n) return false;
    if (s[pos]!=(*k)) return false;
    INC_POS;
    k++;
  }
  if (pos>=n) return true;
  if (is_alpha (s[pos])) return false;
  return true;
}
void texmacs_command ( const string cmd)

Definition at line 36 of file mmx_texmacs.cpp.

References texmacs_pending.

Referenced by texmacs_dynamic_event().

                                    {
  texmacs_pending << " " << cmd << "\n";
}
void texmacs_dynamic_event ( const string id,
const generic val 
)

Definition at line 52 of file mmx_texmacs.cpp.

References as_generic(), as_texmacs_snippet(), flatten(), texmacs_command(), and val.

                                                             {
  string v= as_texmacs_snippet (as_generic (flatten (val)));
  texmacs_command ("(locus-set \"" * id * "\" '" * v * ")");
}
generic texmacs_expand ( const generic g)

Definition at line 397 of file mmx_texmacs.cpp.

References gen(), is_func(), literal_to_string(), N(), and starts().

Referenced by serialize().

                                  {
  if (is_func (g, "tm$with"))
    return texmacs_expand (g[N(g)-1]);
  else if (is_func (g, "tm$itemize", 1) || is_func (g, "tm$enumerate", 1))
    return gen ("$indent", texmacs_expand (g[1]));
  else if (is_func (g, "tm$item", 0))
    return generic ("* ");
  else if (is_func (g, "tm$folded", 2))
    return gen ("$varindent",
                gen ("$concat",
                     generic ("o "), texmacs_expand (g[1])));
  else if (is_func (g, "tm$unfolded", 2))
    return gen ("$varindent",
                gen ("$concat",
                     generic ("* "), texmacs_expand (g[1]),
                     generic ("$lf"), texmacs_expand (g[2])));
  else if (is_func (g, "tm$folded-explain", 2))
    return texmacs_expand (g[1]);
  else if (is_func (g, "tm$unfolded-explain", 2))
    return gen ("$concat", texmacs_expand (g[1]),
                generic ("$lf"), generic ("$lf"), texmacs_expand (g[2]));
  else if (is_func (g, "tm$explain", 2))
    return gen ("$concat", texmacs_expand (g[1]), generic ("$lf"),
                gen ("$indent", texmacs_expand (g[2])));
  else if (is_func (g, "tm$explain-synopsis", 1))
    return gen ("$concat", generic (" --- "), texmacs_expand (g[1]));
  else if (is<compound> (g)) {
    vector<generic> v;
    for (nat i=1; i<N(g); i++) v << texmacs_expand (g[i]);
    if (is<literal> (g[0]) && starts (literal_to_string (g[0]), "tm$")) {
      if (N(v) == 1) return v[0];
      else return gen ("$concat", v);
    }
    else return gen (g[0], v);
  }
  else return g;
}
string texmacs_flush_commands ( )

Definition at line 41 of file mmx_texmacs.cpp.

References DATA_BEGIN, DATA_END, s, and texmacs_pending.

                          {
  if (texmacs_pending == "") return "";
  string s=
    string (DATA_BEGIN) *
    "command:(begin" * texmacs_pending * ")" *
    string (DATA_END);
  texmacs_pending= "";
  return s;
}
static table<generic,generic> mmx::texmacs_symbol_table ( ) [static]

Definition at line 99 of file mmx_texmacs.cpp.

References init().

Referenced by as_texmacs().

                        {
  table<generic,generic> t;

  init (t, "/\\", "tm$wedge");
  init (t, "mathcatalan", "tm$mathcatalan");
  init (t, "@", "tm$circ");
  init (t, "><", "tm$join");
  init (t, "derivative", "D");
  init (t, "mathe", "tm$mathe");
  init (t, "<=>", "tm$Leftrightarrow");
  init (t, "matheuler", "tm$matheuler");
  init (t, ">", "tm$gtr");
  init (t, ">=", "tm$geqslant");
  init (t, ">>", "tm$gg");
  init (t, "mathi", "tm$mathi");
  init (t, "=>", "tm$Rightarrow");
  init (t, "Infty", "tm$infty");
  init (t, "->", "tm$rightarrow");
  init (t, "<", "tm$less");
  init (t, "<=", "tm$leqslant");
  init (t, "<<", "tm$ll");
  init (t, ":->", "tm$mapsto");
  init (t, ".!", "!");
  init (t, "!", "tm$neg");
  init (t, "\\/", "tm$vee");
  init (t, "partial", "tm$partial");
  init (t, "mathpi", "tm$mathpi");
  init (t, ".'", "'");
  init (t, ".`", "`");
  init (t, "..", "tm$ldots");
  init (t, "::", "tm$colons");
  init (t, ":>", "tm$transtype");
  init (t, "!=", "tm$neq");
  init (t, "|", "|");
  init (t, "||", "tm$||");
  init (t, "xor", "tm$veebar");
  init (t, ":=", "tm$assign");
  init (t, "+=", "tm$plusassign");
  init (t, "-=", "tm$minusassign");
  init (t, "*=", "tm$astassign");
  init (t, "/=", "tm$overassign");

  init (t, "alpha", "tm$alpha");
  init (t, "beta", "tm$beta");
  init (t, "gamma", "tm$gamma");
  init (t, "delta", "tm$delta");
  init (t, "epsilon", "tm$varepsilon");
  init (t, "zeta", "tm$zeta");
  init (t, "eta", "tm$eta");
  init (t, "theta", "tm$theta");
  init (t, "iota", "tm$iota");
  init (t, "kappa", "tm$kappa");
  init (t, "lambda", "tm$lambda");
  init (t, "mu", "tm$mu");
  init (t, "nu", "tm$nu");
  init (t, "xi", "tm$xi");
  init (t, "omicron", "tm$omicron");
  init (t, "pi", "tm$pi");
  init (t, "rho", "tm$rho");
  init (t, "sigma", "tm$sigma");
  init (t, "tau", "tm$tau");
  init (t, "upsilon", "tm$upsilon");
  init (t, "phi", "tm$varphi");
  init (t, "chi", "tm$chi");
  init (t, "psi", "tm$psi");
  init (t, "omega", "tm$omega");

  init (t, "Alpha", "tm$Alpha");
  init (t, "Beta", "tm$Beta");
  init (t, "Gamma", "tm$Gamma");
  init (t, "Delta", "tm$Delta");
  init (t, "Epsilon", "tm$Epsilon");
  init (t, "Zeta", "tm$Zeta");
  init (t, "Eta", "tm$Eta");
  init (t, "Theta", "tm$Theta");
  init (t, "Iota", "tm$Iota");
  init (t, "Kappa", "tm$Kappa");
  init (t, "Lambda", "tm$Lambda");
  init (t, "Mu", "tm$Mu");
  init (t, "Nu", "tm$Nu");
  init (t, "Xi", "tm$Xi");
  init (t, "Omicron", "tm$Omicron");
  init (t, "Pi", "tm$Pi");
  init (t, "Rho", "tm$Rho");
  init (t, "Sigma", "tm$Sigma");
  init (t, "Tau", "tm$Tau");
  init (t, "Upsilon", "tm$Upsilon");
  init (t, "Phi", "tm$Phi");
  init (t, "Chi", "tm$Chi");
  init (t, "Psi", "tm$Psi");
  init (t, "Omega", "tm$Omega");

  return t;
}
static void mmx::texmacs_to_scheme ( string s,
const generic g 
) [static]

Definition at line 440 of file mmx_texmacs.cpp.

References ASSERT, compound_to_vector(), ERROR, literal_to_string(), mmerr, N(), quote(), and starts().

Referenced by as_snippet(), as_texmacs_scheme(), and as_texmacs_snippet().

                                                {
  //mmerr << "g= " << as_lisp (g) << "\n";
  if (is<literal> (g)) s << quote (literal_to_string (g));
  else if (is<compound> (g) && is<literal> (g[0]) &&
           literal_to_string (g[0]) == " ")
    s << "\" \"";
  else if (is<compound> (g) && is<literal> (g[0])) {
    string op= literal_to_string (g[0]);
    if (starts (op, "tm$")) op= op (2, N(op));
    if (!starts (op, "$")) {
      mmerr << "op  = " << op << "\n";
      mmerr << "args= " << compound_to_vector (g) << "\n";
    }
    ASSERT (starts (op, "$"), "invalid TeXmacs markup");
    s << "(" << op (1, N(op));
    for (nat i=1; i<N(g); i++) {
      s << " ";
      texmacs_to_scheme (s, g[i]);
    }
    s << ")";
  }
  else ERROR ("invalid TeXmacs markup");
}
syntactic& mmx::the_polynomial_var ( )

Definition at line 505 of file syntactic.cpp.

                      {
  static syntactic v ("x");
  return v;
}
syntactic& mmx::the_series_var ( )

Definition at line 499 of file syntactic.cpp.

                  {
  static syntactic v ("z");
  return v;
}
C3 mmx::third ( const triple< C1, C2, C3 > &  t) [inline]

Definition at line 42 of file triple.hpp.

{ return t.x3; }
void threads_execute ( task *  ts,
nat  n 
)

Definition at line 224 of file threads.cpp.

References inside(), and n.

Referenced by threads_simple_loop().

                                       {
  for (nat i=0; i<n; i++) inside (ts[i]) -> execute (); }
int threads_get_number ( )

Definition at line 219 of file threads.cpp.

{ return 1; }
void threads_initialize ( nat  n)

Definition at line 217 of file threads.cpp.

{ (void) n; }
void threads_set_number ( const int &  n)

Definition at line 220 of file threads.cpp.

References ASSERT.

                                       {
  ASSERT (n == 1, "multithreading disabled"); }
void threads_simple_loop ( nat  nr_instances,
nat  nr_iterations 
)

Definition at line 282 of file threads.cpp.

References threads_execute().

                                                          {
  task ts[nr_instances];
  for (nat id=0; id<nr_instances; id++)
    ts[id]= new loop_task_rep (nr_iterations);
  threads_execute (ts, nr_instances);
}
void threads_terminate ( )

Definition at line 218 of file threads.cpp.

{}
double times_infinity ( const double &  x) [inline]

Definition at line 37 of file double.hpp.

Referenced by GLUE_37(), and set_infinity().

{ return x * HUGE_VAL; }
vector< string > tokenize ( const string s,
const string sep,
bool  keep = false 
)

Cut into pieces, using as a separator.

Definition at line 545 of file string.cpp.

References ASSERT, min(), N(), s, and start.

Referenced by add_indentation(), documentify(), get_indentation(), store_file_source(), and store_interactive_source().

                                                         {
  ASSERT (N(sep) != 0, "separator should be non-empty");
  vector<string> v;
  nat start= 0;
  while (start < N(s)) {
    nat end= start;
    while (end < N(s) &&
           (s[end] != sep[0] || s (end, min (N(s), end + N(sep))) != sep))
      end++;
    if (keep) v << (s (start, end) * sep);
    else v << s (start, end);
    start= end + N(sep);
  }
  return v;
}
generic trace_bottom ( const generic exc,
nat  n = 1 
)

Definition at line 76 of file exception.cpp.

References trace_depth(), and trace_pull().

Referenced by source_exception().

                                         {
  generic g= exc;
  nat d= trace_depth (exc);
  for (nat i=n; i<d; i++) g= trace_pull (g);
  return g;
}
nat mmx::trace_depth ( const generic exc)

Definition at line 70 of file exception.cpp.

References has_trace(), and trace_pull().

Referenced by trace_bottom().

                                 {
  if (has_trace (exc)) return trace_depth (trace_pull (exc)) + 1;
  else return 1;
}
generic trace_pull ( const generic exc)

Definition at line 54 of file exception.cpp.

References ASSERT, exception, gen(), GEN_BACKTRACE, GEN_EXCEPTION, and is_func().

Referenced by backtrace(), trace_bottom(), and trace_depth().

                                {
  generic msg= *as<exception> (exc);
  ASSERT (is_func (msg, GEN_EXCEPTION, 2), "invalid exception");
  ASSERT (is_func (msg[2], GEN_BACKTRACE, 2), "backtrace expected");
  return as<generic> (exception (gen (msg[0], msg[1], msg[2][2])));
}
generic trace_push ( const generic exc,
const generic where 
)

Definition at line 46 of file exception.cpp.

References ASSERT, exception, gen(), GEN_BACKTRACE, GEN_EXCEPTION, and is_func().

                                                      {
  generic msg= *as<exception> (exc);
  ASSERT (is_func (msg, GEN_EXCEPTION, 2), "invalid exception");
  generic w= gen (GEN_BACKTRACE, where, msg[2]);
  return as<generic> (exception (gen (msg[0], msg[1], w)));
}
generic trace_top ( const generic exc)

Definition at line 62 of file exception.cpp.

References ASSERT, exception, gen(), GEN_BACKTRACE, GEN_EXCEPTION, and is_func().

Referenced by backtrace().

                               {
  generic msg= *as<exception> (exc);
  ASSERT (is_func (msg, GEN_EXCEPTION, 2), "invalid exception");
  ASSERT (is_func (msg[2], GEN_BACKTRACE, 2), "backtrace expected");
  return as<generic> (exception (gen (msg[0], "backtrace", msg[2][1])));
}
syntactic trig ( const syntactic g)

Definition at line 417 of file syntactic.cpp.

References cos(), GEN_SQTUPLE, sin(), and syn().

                                    {
  return syn (GEN_SQTUPLE, cos (g), sin (g)); }
generic trig ( const generic x1)

Definition at line 546 of file generic.cpp.

References comma(), cos(), sin(), and xsqtuple().

Referenced by trig_op::op(), trig_op::op_init(), and trig_op::set_op().

                                 {
  return xsqtuple (comma (cos (x1), sin (x1))); }
vector<C> mmx::trig ( const vector< C > &  v)

Definition at line 1220 of file vector.hpp.

References cos(), sin(), and vec().

                                                         {
  return vec (cos (v[0]), sin (v[0])); }
mmx::TRUE_IDENTITY_OP_SUGAR ( template< typename C, typename T, typename V >  ,
sparse_vector< C, T, V >   
)
mmx::TRUE_IDENTITY_OP_SUGAR ( template< typename C1, typename C2 >  ,
pair< C1, C2 >   
)
mmx::TRUE_IDENTITY_OP_SUGAR ( template< typename C, typename V >  ,
vector< C, V >   
)
mmx::TRUE_IDENTITY_OP_SUGAR ( template< typename C >  ,
chain< C >   
)
mmx::TRUE_IDENTITY_OP_SUGAR ( template< typename C >  ,
list< C >   
)
mmx::TRUE_IDENTITY_OP_SUGAR ( template< typename C, typename T, typename V >  ,
table< C, T, V >   
)
mmx::TRUE_IDENTITY_OP_SUGAR ( template< typename C >  ,
heap< C >   
)
mmx::TRUE_IDENTITY_OP_SUGAR ( template< typename C1, typename C2, typename C3 >  ,
triple< C1, C2, C3 >   
)
double trunc ( const double &  x) [inline]

Definition at line 126 of file double.hpp.

Referenced by trunc_op::op(), and trunc_op::set_op().

{ return ::trunc (x); }
generic trunc ( const generic x)

Definition at line 750 of file generic.cpp.

References current_ev, and GEN_TRUNC.

                                 {
  return current_ev->apply (GEN_TRUNC, x); }
nat mmx::tuple_to_scalar ( nat  id) [inline]

Definition at line 105 of file tuple.hpp.

References tuple_type_info().

                         {
  bool mode= false;
  tuple_type_info (id, mode);
  return id;
}
void tuple_type_info ( nat id,
bool &  mode 
)

Definition at line 17 of file tuple.cpp.

References new_type_id(), and read().

Referenced by is_tuple_type(), new_tuple_type_id(), and tuple_to_scalar().

                                      {
  static table<nat,nat> t (0);
  static table<nat,nat> u (0);
  if (mode == false) {
    mode= t->contains (id);
    id= read (t, id);
  }
  else {
    if (u->contains (id)) id= u[id];
    else {
      nat new_id= new_type_id ();
      t[new_id]= id;
      u[id]= new_id;
      id= new_id;
    }
  }
}
nat mmx::type_id ( ) [inline]

Definition at line 191 of file generic.hpp.

                                           {
  return type_information<C>::id; }
nat type_id ( const generic name)

Definition at line 78 of file glue.cpp.

References current_ev, gen(), and GEN_TYPE_ID.

Referenced by define_type_helper< C >::def_type(), get_user_type(), and generic_object_rep::same_type().

                              {
  generic id;
  if (current_ev->get (gen (GEN_TYPE_ID, name), id) && is<nat> (id))
    return as<nat> (id);
  else return 1;
}
generic type_mismatch ( const generic expect,
const generic where 
)

Definition at line 41 of file exception.cpp.

References std_exception().

                                                            {
  return std_exception ("expected ", expect, where);
}
vector<generic> mmx::type_name ( const vector< nat > &  ids)

Definition at line 24 of file routine.cpp.

References N(), n, and type_name().

                                   {
  nat i, n= N(ids);
  vector<generic> ret= fill<generic> (n);
  for (i=0; i<n; i++)
    ret[i]= type_name (ids[i]);
  return ret;
}
generic type_name ( const generic g)

Definition at line 94 of file glue.cpp.

References type(), and type_name().

                             {
  return type_name (type (g));
}
generic type_name ( nat  id)

Definition at line 86 of file glue.cpp.

References current_ev, gen(), GEN_TYPE_NAME, and GEN_UNSPECIFIED_TYPE.

Referenced by convert(), flatten_type(), routine_rep::function_type(), object_flatten(), operator<<(), replace_lf(), and type_name().

                   {
  generic name;
  if (current_ev->get (gen (GEN_TYPE_NAME, as<generic> (id)), name))
    return name;
  else return GEN_UNSPECIFIED_TYPE;
}
generic type_name ( ) [inline]

Definition at line 193 of file generic.hpp.

References type_name().

                                                 {
  return type_name (type_id<C> ()); }
static generic mmx::un_try_catch ( const generic g) [static]

Definition at line 379 of file mmx_printer.cpp.

References cdr(), compound_to_vector(), gen(), GEN_BEGIN, is_func(), and N().

                                {
  vector<generic> v;
  if (is_func (g[1], GEN_BEGIN)) v << cdr (compound_to_vector (g[1]));
  else v << g[1];
  for (nat i=2; i<N(g); i++) v << g[i];
  return gen (g[0], gen (GEN_BEGIN, v));
}
table<C,T,V> mmx::unary_filter ( const table< C, T, V > &  t)

Definition at line 574 of file table.hpp.

References busy(), entries(), I(), and Table.

                              {
  Table r (I(t));
  for (iterator<T> it= entries (t); busy (it); ++it)
    if (Op::op (*it)) r[*it]= t[*it];
  return r;
}
nat mmx::unary_hash ( const vector< C, V > &  v)

Definition at line 741 of file vector.hpp.

References N(), and n.

                                  {
  register nat i, h= 12345, n= N(v);
  for (i=0; i<n; i++)
    h= (h<<1) ^ (h<<5) ^ (h>>27) ^ Op::op (v[i]);
  return h;
}
nat mmx::unary_hash ( const triple< C1, C2, C3 > &  t)

Definition at line 48 of file triple.hpp.

                             {
  nat h1= Op::op (t.x1), h2= Op::op (t.x2);
  return h1 ^ h2 ^ (h1<<3) ^ (h2<<5) ^ Op::op (t.x3);
}
nat mmx::unary_hash ( const iterator< C > &  it)

Definition at line 156 of file iterator.hpp.

                                {
  (void) it; return 20077002;
  /*
  Iterator it1= copy (it);
  register nat h= 20077002;
  while (busy (it1)) {
    h= (h<<3) ^ (h>>29) ^ Op::op (*it1);
    ++it1;
  }
  return h;
  */
}
nat mmx::unary_hash ( const list< C > &  ll)

Definition at line 210 of file list.hpp.

References is_nil(), List, read_car(), and read_cdr().

                            {
  List l= ll;
  register nat h= 253648;
  while (!is_nil (l)) {
    h= (h<<1) ^ (h<<5) ^ (h>>27) ^ Op::op (read_car (l));
    l= read_cdr (l);
  }
  return h;
}
nat mmx::unary_hash ( const table< C, T, V > &  t)

Definition at line 465 of file table.hpp.

References busy(), iterate(), pair< C1, C2 >::x1, and pair< C1, C2 >::x2.

                            {
  // we add all hash codes of the element pairs; don't "cycle",
  // because the order of the element pairs is not uniquely determined
  nat h=54321;
  for (iterator<pair<T,C> > it= iterate (t); busy (it); ++it) {
    pair<T,C> p= *it;
    nat key_h= V::key_op::hash_op (p.x1);
    nat val_h= Op::op (p.x2);
    h += (key_h << 5) ^ (key_h >> 27) ^ val_h;
  }
  return h;
}
nat mmx::unary_hash ( const chain< C > &  c)

Definition at line 221 of file chain.hpp.

References is_nil(), left(), middle(), and right().

                            {
  if (is_nil (c)) return 1928;
  nat h1= Op::op (left (c));
  nat h2= Op::op (middle (c));
  nat h3= Op::op (right (c));
  return h1 ^ (h2>>1) ^ (h2<<31) ^ (h3>>3) ^ (h3>>29);
}
nat mmx::unary_hash ( const sparse_vector< C, T, V > &  v)

Definition at line 150 of file sparse_vector.hpp.

References N().

                                    {
  nat h=1236321;
  for (nat i=0; i<N(v); i++)
    h = (h << 5) ^ (h >> 27) ^ Op::op (v[i]);
  return h;
}
nat mmx::unary_hash ( const heap< C > &  HH)

Definition at line 226 of file heap.hpp.

References copy(), Heap, N(), and pull().

                            {
  Heap H= copy (HH);
  register nat h= 2531648;
  while (N(H) > 0)
    h= (h<<1) ^ (h<<5) ^ (h>>27) ^ Op::op (pull (H));
  return h;
}
nat mmx::unary_hash ( const pair< C1, C2 > &  p)

Definition at line 43 of file pair.hpp.

                           {
  nat h= Op::op (p.x1);
  return (h<<1) ^ (h<<3) ^ (h<<9) ^ (h>>29) ^ Op::op (p.x2);
}
table<C,T,V> mmx::unary_map ( const table< C, T, V > &  t)

Definition at line 487 of file table.hpp.

References busy(), CF2(), entries(), I(), simplify(), and Table.

                           {
  Table r (Op::op (I(t)), CF2(t));
  for (iterator<T> it= entries (t); busy (it); ++it)
    r[*it]= Op::op (t[*it]);
  simplify (r);
  return r;
}
sparse_vector<C,T,V> sparse_vector<C,T,V> mmx::unary_map ( const sparse_vector< C, T, V > &  v)

Definition at line 175 of file sparse_vector.hpp.

References N(), n, Pair, and Sparse_vector.

                                   {
  typedef typename V::val_op Eq;
  nat i, j, n= N(v);
  Pair* r= mmx_new<Pair > (n);
  for (i= j= 0; i < n; i++) {
    Pair e (v[i].x1, Op::op (v[i].x2));
    if (Eq::not_op (e.x2, C (0))) r[j++]= e;
  }
  return Sparse_vector (r, j, n);
}
vector<Unary_return_type(Op,C),V> mmx::unary_map ( const vector< C, V > &  v)

Definition at line 750 of file vector.hpp.

References C, CF(), is_a_scalar(), N(), n, vector< C, V >::scalar(), seg(), T, and Unary_return_type().

                                 {
  typedef implementation<vector_linear,V> Vec;
  typedef Unary_return_type(Op,C) T;
  format<T> fm= unary_map<Op> (CF(v));
  if (is_a_scalar (v)) return vector<T,V> (Op::op (v.scalar()));
  nat n= N(v);
  nat l= aligned_size<T,V> (n);
  T* r= mmx_formatted_new<T> (l, fm);
  Vec::template vec_unary<Op> (r, seg (v), n);
  return vector<T,V> (r, n, l, fm);
}
format<typename unary_return_type_helper< Op , C >::RET > mmx::unary_map ( const format< C > &  fm)

Definition at line 536 of file type_props.hpp.

References C, and Unary_return_type().

                                {
  typedef Unary_return_type(Op,C) R;
  typedef typename format<R>::FT FT;
  return format_unary_map_helper<Op,FT,R,C>::op (fm);
}
mmx::UNARY_RETURN_TYPE ( template< typename C, typename V >  ,
Re_op  ,
vector< C, V >  ,
vector< Real_type(C), V >   
)
V Unary_return_type ( Op  ,
 
) const

Referenced by unary_map().

mmx::UNARY_RETURN_TYPE ( template< typename C, typename V >  ,
center_op  ,
vector< C, V >  ,
vector< Center_type(C), V >   
)
mmx::UNARY_RETURN_TYPE ( template< typename C, typename V >  ,
radius_op  ,
vector< C, V >  ,
vector< Radius_type(C), V >   
)
mmx::UNARY_RETURN_TYPE ( template< typename C, typename V >  ,
abs_op  ,
vector< C, V >  ,
vector< Abs_type(C), V >   
)
vector<T,V>& mmx::unary_set ( vector< T, V > &  v,
const vector< C, V > &  w 
)

Definition at line 804 of file vector.hpp.

References ASSERT, extend(), is_a_scalar(), is_non_scalar(), N(), n, vector< C, V >::scalar(), and seg().

                                                 {
  typedef implementation<vector_linear,V> Vec;
  if (is_a_scalar (v) || is_a_scalar (w)) {
    if (is_non_scalar (v))
      return unary_set<Op> (v, extend (w, v));
    else if (is_non_scalar (w))
      v= extend (v, w);
    else {
      Op::set_op (v.scalar(), w.scalar());
      return v;
    }
  }
  nat n= N(v);
  ASSERT (N(w) == n, "lengths don't match");
  Vec::template vec_unary<Op> (seg (v), seg (w), n);
  return v;
}
table<C,T,V>& mmx::unary_set ( table< C, T, V > &  t,
const table< C, T, V > &  u 
)

Definition at line 517 of file table.hpp.

References busy(), entries(), I(), read(), read_I(), and reset().

                                     {
  Op::set_op (I(t), I(u));
  for (iterator<T> it= entries (u); busy (it); ++it) {
    Op::set_op (t[*it], u[*it]);
    if (V::val_op::op (read (t, *it), read_I (t))) reset (t, *it);
  }
  return t;
}
vector<T,V>& mmx::unary_set_scalar ( vector< T, V > &  v,
const X &  x 
)

Definition at line 823 of file vector.hpp.

References is_a_scalar(), N(), n, vector< C, V >::scalar(), and seg().

                                              {
  typedef implementation<vector_linear,V> Vec;
  if (is_a_scalar (v)) {
    Op::set_op (v.scalar(), x);
    return v;
  }
  nat n= N(v);
  Vec::template vec_unary_scalar<Op> (seg (v), x, n);
  return v;
}
table<C,T,V>& mmx::unary_set_scalar ( table< C, T, V > &  t,
const X &  x 
)

Definition at line 527 of file table.hpp.

References busy(), entries(), I(), and simplify().

                                        {
  Op::set_op (I (t), x);
  for (iterator<T> it= entries (t); busy (it); ++it)
    Op::set_op (t[*it], x);
  simplify (t);
  return t;
}
generic mmx::unbracket ( const generic g)

Definition at line 204 of file mmx_texmacs.cpp.

References is_func().

Referenced by as_texmacs().

                             {
  if (is_func (g, "$bracket", 3)) return g[2];
  else return g;
}
static string mmx::underlined ( const string file_name,
const nat n,
const source_position b,
const source_position e 
) [static]

Definition at line 259 of file source_track.cpp.

References source_position::column, get_source(), source_position::line, line, and N().

Referenced by source_underlined().

{
  // empty file_name means interactive input. In this only situation
  // n means the input number. n is not used for a regular file.
  nat j;
  string line;
  string sout;

  line = get_source (file_name, n, b.line);

  sout << line << "\n";
  for (j=0; j < b.column; ++j)
    sout << " ";
  if (b.line == e.line) {
    for (; j < e.column; ++j)
      sout << "~";
  }
  else {
    if (e.line == b.line+1 && e.column == 0)
      sout << "^";
    else {
      for (; j < N(line); ++j)
        sout << "~";
      sout << "\n";
      if (e.column == 0) {
        if (e.line - 1 > b.line + 1)
          sout << "...\n";
        line = get_source (file_name, n, e.line-1);
        sout << line << "\n";
        for (j=0; j < N(line); ++j)
          sout << "~";
        if (N(line) == 0)
          sout << "^";
      }
      else {
        if (e.line > b.line + 1)
          sout << "...\n";
        line = get_source (file_name, n, e.line);
        sout << line << "\n";
        for (j=0; j < e.column; ++j)
          sout << "~";
      }
    }
  }
  sout << "\n";
  return sout;
}
bool mmx::unequal_operator ( const T &  x,
const T &  y 
)

Definition at line 35 of file operators.hpp.

{ return x!=y; }
string unescape ( const string s)

Replace "\\n", "\\t", and "\\b" respectively by "\n", "\t", and "\b".

Definition at line 463 of file string.cpp.

References n, and N().

Referenced by unquote().

                           {
  int i, n= N(s);
  string r;
  for (i=0; i<n; i++)
    if ((i+1<n) && (s[i] == '\\')) {
      i++;
      if (s[i] == 't') r << '\t';
      else if (s[i] == 'n') r << '\n';
      else if (s[i] == 'r') r << '\r';
      else if (s[i] == 'b') {
        if (N(r)>0)
          r.rep->resize (N(r)-1);
      }
      else r << s[i];
    }
    else r << s[i];
  return r;
}
generic uniform ( const generic x1,
const generic x2 
)

Definition at line 845 of file generic.cpp.

References current_ev.

                                                       {
  return current_ev->apply ("uniform", x1, x2); }
double uniform_deviate ( const double &  lo,
const double &  hi 
)

Definition at line 17 of file double.cpp.

Referenced by GLUE_6().

                                                     {
  double x= ((double) rand ()) / RAND_MAX;
  return lo + (hi - lo) * x;
}
string mmx::unique_identifier ( const dynamic g)

Definition at line 69 of file dynamic.cpp.

References as_string(), and hard_hash().

Referenced by flatten(), and output_observer_rep::modify().

                                     {
  return "mmx-" * as_string (hard_hash (g));
}
string unquote ( const string s)

Remove all the "..." and /"..."/ around s.

Definition at line 488 of file string.cpp.

References ends(), N(), s, starts(), and unescape().

Referenced by GLUE_20(), parse_lisp(), and scheme_to_tm().

                          {
  if ((N(s) >= 2) && (s[0] == '\"') && (s[N(s)-1] == '\"'))
    return unescape (s (1, N(s)-1));
  else if (starts (s, "/\"") && ends (s, "\"/"))
    return s (2, N(s)-2);
  else return unescape (s);
}
string upcase ( const string s)

Replace locases by upcases.

Definition at line 413 of file string.cpp.

References is_locase(), n, and N().

Referenced by GLUE_15().

                         {
  nat i, n= N(s);
  string r (n);
  for (i=0; i<n; i++)
    if (!is_locase (s[i])) r[i]= s[i];
    else r[i]= (char) (((int) ((unsigned char) s[i]))-32);
  return r;
}
string upcase_first ( const string s)

Replace locase by upcase for first letter.

Definition at line 433 of file string.cpp.

References copy(), is_locase(), and N().

Referenced by GLUE_17().

                               {
  string r= copy (s);
  if (N(r) != 0 && is_locase (s[0]))
    r[0]= (char) (((int) ((unsigned char) s[0]))-32);
  return r;
}
vector<Center_type(C),V> mmx::upper ( const vector< C, V > &  v)

Definition at line 1164 of file vector.hpp.

                                           {
  return unary_map<upper_op> (v); }
C mmx::upper ( const C &  x) [inline]

Definition at line 912 of file type_props.hpp.

Referenced by upper_op::Center_type(), and upper_op::set_op().

{ return x; }
string user_dir ( )

Definition at line 89 of file system.cpp.

References ASSERT, and get_env().

Referenced by eval_system(), init_system(), and load_path().

            {
  string dir= get_env ("MMX_USER_DIR");
  if (dir == "") {
    string home = get_env ("HOME");
    ASSERT (home != "", "Can not determine user's directory.\n Please set $MMX_USER_DIR or $HOME.\n");
    dir= home * "/.mathemagix";
  }
  return dir;
}
generic user_exception ( const vector< generic > &  msg,
const generic where 
)

Definition at line 31 of file exception.cpp.

References exception, gen(), and GEN_EXCEPTION.

                                                              {
  return as<generic> (exception (gen (GEN_EXCEPTION, as<generic> (msg), w)));
}
generic mmx::var_flatten ( const generic g)

Definition at line 84 of file generic_utils.cpp.

References as_generic(), and flatten().

Referenced by compare_sub(), and size().

                               {
  return as_generic (flatten (g));
}
bool var_load ( const string file_path,
const string file_name,
string s 
)

Definition at line 438 of file system.cpp.

References get_env(), init_system(), load_path(), n, N(), start, and var_load().

                                                                       {
  if ((N(file_name) > 0) && (file_name[0] == '/'))
    return var_load (file_name, s);
  nat i, n= N(file_path), start= 0;
  for (i=0; i<=n; i++)
    if ((i==n) || (file_path[i] == ':')) {
      string ss= file_path (start, i);
      if ((N(ss) > 0) && (ss[0] == '$')) {
        init_system ();
        if (ss == "$MMX_LOAD_PATH") ss= load_path ();
        else ss= get_env (ss (1, N(ss)));
        if (!var_load (ss, file_name, s)) return false;
      }
      else {
        if (ss == "") ss= ".";
        if (ss[N(ss)-1] != '/') ss= ss * "/";
        if (!var_load (ss * file_name, s)) return false;
      }
      start= i+1;
    }
  return true;
}
bool var_load ( const string file_name,
string s 
)

Definition at line 421 of file system.cpp.

References can_read(), error_flag(), and input_file_port().

Referenced by eval_system(), load(), and var_load().

                                              {
  port f= input_file_port (file_name);
  if (error_flag (f)) return true;
  char c;
  while (can_read (f) > 0) {
    f >> c;
    s << c;
  }
  return false;
}
bool var_mkdir ( const string name)

Definition at line 501 of file system.cpp.

References as_charp(), file_exists(), free_charp(), mkdir(), and system().

Referenced by init_system(), and mkdir().

                               {
#if defined (BASIX_HAVE_SYS_TYPES_H) && defined (BASIX_HAVE_SYS_STAT_H)
  if (file_exists (name)) return false;
  char* _name= as_charp (name);
#if defined(__MINGW__) || defined(__MINGW32__)
  int r= ::mkdir (_name);
  ::chmod (_name, 744);
#else
  int r= ::mkdir (_name, S_IRWXU + S_IRGRP + S_IROTH);
#endif
  free_charp (_name);
  return r != 0;
#else  
  return system ("mkdir -m 744 -p " * orig_name) != 0;
#endif
}
vector<C> mmx::vec ( const C &  c1,
const C &  c2,
const C &  c3,
const C &  c4,
const C &  c5,
const C &  c6,
const C &  c7,
const C &  c8 
)

Definition at line 446 of file vector.hpp.

References C, Format, and get_format().

                                                         {
  Format fm= get_format (c1);
  nat l= default_aligned_size<C> ((nat) 8);
  C* a= mmx_formatted_new<C> (l, fm);
  a[0]= c1; a[1]= c2; a[2]= c3; a[3]= c4;
  a[4]= c5; a[5]= c6; a[6]= c7; a[7]= c8;
  return vector<C> (a, 8, l, fm);
}
vector<C> mmx::vec ( const C &  c1,
const C &  c2,
const C &  c3,
const C &  c4 
)

Definition at line 408 of file vector.hpp.

References C, Format, and get_format().

                                                         {
  Format fm= get_format (c1);
  nat l= default_aligned_size<C> ((nat) 4);
  C* a= mmx_formatted_new<C> (l, fm);
  a[0]= c1; a[1]= c2; a[2]= c3; a[3]= c4;
  return vector<C> (a, 4, l, fm);
}
vector<C> mmx::vec ( const C &  c1,
const C &  c2,
const C &  c3,
const C &  c4,
const C &  c5,
const C &  c6,
const C &  c7 
)

Definition at line 436 of file vector.hpp.

References C, Format, and get_format().

                                            {
  Format fm= get_format (c1);
  nat l= default_aligned_size<C> ((nat) 7);
  C* a= mmx_formatted_new<C> (l, fm);
  a[0]= c1; a[1]= c2; a[2]= c3; a[3]= c4; a[4]= c5; a[5]= c6; a[6]= c7;
  return vector<C> (a, 7, l, fm);
}
vector<C> mmx::vec ( const C &  c1,
const C &  c2 
)

Definition at line 390 of file vector.hpp.

References C, Format, and get_format().

                               {
  Format fm= get_format (c1);
  nat l= default_aligned_size<C> ((nat) 2);
  C* a= mmx_formatted_new<C> (l, fm);
  a[0]= c1; a[1]= c2;
  return vector<C> (a, 2, l, fm);
}
vector<C> mmx::vec ( const C &  c1,
const C &  c2,
const C &  c3,
const C &  c4,
const C &  c5 
)

Definition at line 417 of file vector.hpp.

References C, Format, and get_format().

                                                                      {
  Format fm= get_format (c1);
  nat l= default_aligned_size<C> ((nat) 5);
  C* a= mmx_formatted_new<C> (l, fm);
  a[0]= c1; a[1]= c2; a[2]= c3; a[3]= c4; a[4]= c5;
  return vector<C> (a, 5, l, fm);
}
vector<C> mmx::vec ( const format< C > &  fm)

Definition at line 374 of file vector.hpp.

References C.

                       {
  nat l= default_aligned_size<C> ((nat) 0);
  C* a= mmx_formatted_new<C> (l, fm);
  return vector<C> (a, 0, l, fm);
}
vector<C> mmx::vec ( const C &  c1,
const C &  c2,
const C &  c3,
const C &  c4,
const C &  c5,
const C &  c6 
)

Definition at line 426 of file vector.hpp.

References C, Format, and get_format().

                                            {
  Format fm= get_format (c1);
  nat l= default_aligned_size<C> ((nat) 6);
  C* a= mmx_formatted_new<C> (l, fm);
  a[0]= c1; a[1]= c2; a[2]= c3; a[3]= c4; a[4]= c5; a[5]= c6;
  return vector<C> (a, 6, l, fm);
}
vector<C> mmx::vec ( const C &  c1,
const C &  c2,
const C &  c3 
)

Definition at line 399 of file vector.hpp.

References C, Format, and get_format().

                                            {
  Format fm= get_format (c1);
  nat l= default_aligned_size<C> ((nat) 3);
  C* a= mmx_formatted_new<C> (l, fm);
  a[0]= c1; a[1]= c2; a[2]= c3;
  return vector<C> (a, 3, l, fm);
}
vector<C> mmx::vec ( )
Examples:
vector_test.cpp.

Definition at line 366 of file vector.hpp.

References C, and Format.

Referenced by apply(), as_texmacs(), compose(), cos_sin(), trig_op::diff_op(), and trig().

       {
  Format fm;
  nat l= default_aligned_size<C> ((nat) 0);
  C* a= mmx_formatted_new<C> (l, fm);
  return vector<C> (a, 0, l, fm);
}
vector<C> mmx::vec ( const C &  c1)

Definition at line 381 of file vector.hpp.

References C, Format, and get_format().

                  {
  Format fm= get_format (c1);
  nat l= default_aligned_size<C> ((nat) 1);
  C* a= mmx_formatted_new<C> (l, fm);
  a[0]= c1;
  return vector<C> (a, 1, l, fm);
}
generic vector_access ( const generic g,
nat  i 
)
generic mmx::vector_append_several ( const tuple< vector< generic > > &  t)

Definition at line 123 of file glue_vector_map.cpp.

References N(), and rebuild().

Referenced by glue_vector_map().

                                                         {
  vector<generic> r;
  for (nat i=0; i<N(t); i++)
    r << t[i];
  return rebuild (r);
}
generic mmx::vector_apply ( const generic f,
const vector< generic > &  a 
)

Definition at line 131 of file glue_vector_map.cpp.

References default_routine().

Referenced by glue_vector_map().

                                                          {
  routine fun= is<routine> (f)? as<routine> (f): default_routine (f);
  return fun->apply (a);
}
generic mmx::vector_foreach ( const generic f,
const tuple< vector< generic > > &  t 
)

Definition at line 117 of file glue_vector_map.cpp.

References gen(), GEN_TUPLE, and vector_map().

Referenced by glue_vector_map().

                                                                    {
  generic r= vector_map (f, t);
  return as<generic> (tuple<generic> (gen (GEN_TUPLE)));
}
generic mmx::vector_map ( const generic f,
const tuple< vector< generic > > &  t 
)

Definition at line 99 of file glue_vector_map.cpp.

References ASSERT, compound_to_vector(), default_routine(), n, N(), rebuild(), vector_map_1(), vector_map_2(), and vector_map_n().

Referenced by glue_vector_map(), and vector_foreach().

                                                                {
  routine fun= is<routine> (f)? as<routine> (f): default_routine (f);
  switch (N(t)) {
  case 0: ASSERT (N(t)>0, "wrong number of arguments");
  case 1: return rebuild (vector_map_1 (fun, t[0]));
  case 2: return rebuild (vector_map_2 (fun, t[0], t[1]));
  default:
    {
      const vector<generic> a= compound_to_vector (*t);
      nat i, n= N(a)-1;
      vector<vector<generic> > b= fill<vector<generic> > (n);
      for (i=0; i<n; i++) b[i]= as<vector<generic> > (a[i+1]);
      return rebuild (vector_map_n (fun, b));
    }
  }
}
vector<generic> mmx::vector_map_1 ( const routine fun,
const vector< generic > &  v 
)

Definition at line 32 of file glue_vector_map.cpp.

References is_a_scalar(), mmout, N(), and n.

Referenced by vector_map().

                                                            {
  if (is_a_scalar (v)) mmout << fun << ", " << v << "\n";
  //mmout << fun << ", " << v << ", " << is_a_scalar (v) << "\n";
  if (is_a_scalar (v)) return vector<generic> (fun->apply (v.scalar()));
  nat n= N(v);
  generic* r= mmx_new<generic> (n);
  for (nat i=0; i<n; i++)
    r[i]= fun->apply (v[i]);
  //mmout << "  -> " << vector<generic> (r, n) << "\n";
  return vector<generic> (r, n, format<generic> ());
}
vector<generic> mmx::vector_map_2 ( const routine fun,
const vector< generic > &  v1,
const vector< generic > &  v2 
)

Definition at line 45 of file glue_vector_map.cpp.

References ASSERT, extend(), is_a_scalar(), is_non_scalar(), n, N(), and vector< C, V >::scalar().

Referenced by vector_map().

{
  if (is_a_scalar (v1) || is_a_scalar (v2)) {
    if (is_non_scalar (v1)) return vector_map_2 (fun, v1, extend (v2, v1));
    if (is_non_scalar (v2)) return vector_map_2 (fun, extend (v1, v2), v2);
    return vector<generic> (fun->apply (v1.scalar(), v2.scalar()));
  }
  ASSERT (N (v1) == N (v2), "vectors of unequal lengths");
  nat n= N(v1);
  generic* r= mmx_new<generic> (n);
  for (nat i=0; i<n; i++)
    r[i]= fun->apply (v1[i], v2[i]);
  return vector<generic> (r, n, format<generic> ());
}
vector<generic> mmx::vector_map_n ( const routine fun,
const vector< vector< generic > > &  a 
)

Definition at line 62 of file glue_vector_map.cpp.

References arg(), ASSERT, is_a_scalar(), N(), and n.

Referenced by vector_map().

                                                                     {
  bool all_scalar= true, one_scalar= false;
  nat i, n= N(a), l= 0;
  for (i=0; i<n; i++)
    if (is_a_scalar (a[i])) one_scalar= true;
    else {
      if (all_scalar) l= N(a[i]);
      else ASSERT (N(a[i]) == l, "vectors of unequal lengths");
      all_scalar= false;
    }

  if (all_scalar) {
    vector<generic> arg= fill<generic> (n);
    for (i=0; i<n; i++)
      arg[i]= a[i].scalar();
    return vector<generic> (fun->apply (arg));
  }

  if (one_scalar) {
    vector<vector<generic> > b= fill<vector<generic> > (n);
    for (i=0; i<n; i++)
      if (is_a_scalar (a[i])) b[i]= vector<generic> (a[i].scalar(), l);
      else b[i]= a[i];
    return vector_map_n (fun, b);
  }

  generic* r= mmx_new<generic> (l);
  for (nat j=0; j<l; j++) {
    vector<generic> arg= fill<generic> (n);
    for (i=0; i<n; i++)
      arg[i]= a[i][j];
    r[j]= fun->apply (arg);
  }
  return vector<generic> (r, l, format<generic> ());
}
generic mmx::vector_size ( const generic g)

Definition at line 65 of file generic.cpp.

References as(), is(), and N().

Referenced by void_binary_helper< table< C, T, V > >::size().

                                       {
  if (!is<vector<generic> > (g)) return 0;
  else return N(as<vector<generic> > (g)); }
vector<generic> mmx::vector_sort ( const vector< generic > &  v)

Definition at line 139 of file glue_vector_map.cpp.

References copy(), and sort().

Referenced by glue_vector_map().

                                       {
  vector<generic> r= copy (v);
  sort (r);
  return r;
}
vector<generic> mmx::vector_sort_leq ( const vector< generic > &  v,
const generic f 
)

Definition at line 153 of file glue_vector_map.cpp.

References copy(), current_comparison, and default_routine().

Referenced by glue_vector_map().

                                                             {
  routine old_comparison= current_comparison;
  current_comparison= is<routine> (f)? as<routine> (f): default_routine (f);
  vector<generic> r= copy (v);
  sort_leq<vector_sort_leq_op> (r);
  current_comparison= old_comparison;
  return r;
}
generic vector_to_compound ( const vector< generic > &  v)

Definition at line 22 of file compound.cpp.

Referenced by access(), add_modes(), append(), apply(), cdr(), cons(), flatten(), parse_lisp(), range(), WRAP_BINARY_IMPL_1(), and xgen().

                                              {
  return as<generic> (compound (v));
}
generic mmx::vlist ( const vector< generic > &  v) [inline]

Definition at line 147 of file mmx_printer.cpp.

References gen().

                                                {
  return gen ("$vlist", v); }
bool mmx::wait ( const port &  p,
int  msec 
) [inline]

Definition at line 115 of file port.hpp.

References inside().

Referenced by GLUE_19(), and composite_port_rep::wait().

                                           {
  return inside (p)->wait (msec); }
nat wait_port_event ( int  msecs)

Definition at line 99 of file posix_port.cpp.

References busy(), entries(), in_count, and max().

Referenced by GLUE_22().

                            {
  //mmout << "Global wait " << msecs << " ms\n";
  int max_fd= 0;

  fd_set in_fds;
  FD_ZERO (&in_fds);
  for (iterator<int> it= entries (in_count); busy (it); ++it) {
    //mmout << "  Setting " << (*it) << "\n";
    FD_SET (*it, &in_fds);
    max_fd= max (max_fd, (*it) + 1);
  }
  
  nat nr;
  struct timeval tv;
  tv.tv_sec  = msecs / 1000;
  tv.tv_usec = 1000 * (msecs % 1000);
  if (msecs < 0) nr= select (max_fd, &in_fds, NULL, NULL, NULL);
  else nr= select (max_fd, &in_fds, NULL, NULL, &tv);
  //mmout << "Received " << nr << "\n";
  return nr;
}
mmx::WRAP_BINARY_IMPL_1 ( template< typename C >  ,
row_tuple< C >  ,
generic  ,
"Rtu"  ,
"Row_tuple"  ,
 
) const

Definition at line 52 of file row_tuple.hpp.

References GEN_ROW, N(), n, Row_tuple, and vector_to_compound().

                                  {
  nat i, n= N(a);
  vector<generic> t= fill<generic> (n+1);
  t[0]= GEN_ROW;
  for (i=0; i<n; i++)
    t[i+1]= as<generic> (a[i]);
  return Row_tuple (vector_to_compound (t));
}
mmx::WRAP_BINARY_IMPL_1 ( template< typename C >  ,
tuple< C >  ,
generic  ,
"Tu"  ,
"Tuple"  ,
 
) const

Definition at line 50 of file tuple.hpp.

References GEN_TUPLE, N(), n, Tuple, and vector_to_compound().

                              {
  nat i, n= N(a);
  vector<generic> t= fill<generic> (n+1);
  t[0]= GEN_TUPLE;
  for (i=0; i<n; i++)
    t[i+1]= as<generic> (a[i]);
  return Tuple (vector_to_compound (t));
}
mmx::WRAP_INDIRECT_IMPL ( template< typename C >  inline,
alias< C >   
)

Definition at line 62 of file alias.hpp.

References C, Full_type_name, gen(), and Short_type_name.

                            : public void_binary_helper<Alias > {
  static inline string short_type_name () {
    return "Al" * Short_type_name (C); }
  static inline generic full_type_name () {
    return gen ("Alias", Full_type_name (C)); }
};
mmx::WRAP_INDIRECT_IMPL ( inline  ,
routine   
) const
mmx::WRAP_INDIRECT_IMPL ( template< typename C >  inline,
row_tuple< C >   
) const

Definition at line 45 of file row_tuple.hpp.

References as_syntactic(), cdr(), compound_to_vector(), gen(), and GEN_ROW.

                             {
  return as_syntactic (gen (GEN_ROW, cdr (compound_to_vector (*t))));
}
mmx::WRAP_INDIRECT_IMPL ( template< typename C >  inline,
tuple< C >   
) const

Definition at line 41 of file tuple.hpp.

References N().

                                   { return N (*t) - 1; }
mmx::WRAP_WRAPPED_IMPL ( template< typename C >  inline,
generic_alias< C >   
)

Definition at line 139 of file alias.hpp.

References ASSERT, C, get_genalias(), and set_genalias().

                         : public Alias_rep {
  generic_alias<C> a;
  C* temp;
public:
  inline incarnate_alias_rep (const generic_alias<C>& a2):
    a (a2), temp (NULL) {}
  inline ~incarnate_alias_rep () {
    ASSERT (temp == NULL, "destruction while accessing alias"); }
  inline C get () const { return get_genalias (a); }
  inline C& open () const {
    incarnate_alias_rep<C>* me= const_cast<incarnate_alias_rep<C>*> (this);
    me->temp= mmx_new_one<C> (as<C> (get_genalias (a)));
    return *me->temp; }
  inline void close () const {
    incarnate_alias_rep<C>* me= const_cast<incarnate_alias_rep<C>*> (this);
    set_genalias (a, as<generic> (*temp));
    mmx_delete_one<C> (me->temp);
    me->temp= NULL; }
};
void write ( const port &  p,
const char *  s,
nat  n 
) [inline]
void write ( const port &  p,
const string &  s 
) [inline]

Definition at line 107 of file port.hpp.

References inside(), and N().

                                                   {
  inside (p)->write (inside (s, 0), N(s)); }
static void mmx::write ( string r,
const string s 
) [static]

Definition at line 500 of file mmx_texmacs.cpp.

References ends(), N(), and n.

                                   {
  nat i, n=N(s);
  for (i=0; i<n; i++) {
    char c= s[i];
    if (c == ' ' && ends (r, " ")) r << "\\ ";
    else if (c == '\n') r << "\\n";
    else if (c == '\t') r << "\\t";
    else if (c == '\0') r << "\\0";
    else if (c == '\\') r << "\\\\";
    else if (c == '<') r << "\\<";
    else if (c == '|') r << "\\|";
    else if (c == '>') r << "\\>";
    else if (c == '\34') r << c;
    else if (((unsigned char) c) < ' ') r << '\\' << (c+'@');
    else r << c;
  }
}
generic wrong_nr_args ( const generic where)

Definition at line 36 of file exception.cpp.

References std_exception().

                                     {
  return std_exception ("wrong number of arguments", where);
}
generic xaccess ( const generic f,
const generic args 
)

Definition at line 173 of file generic.cpp.

References comma(), GEN_ACCESS, and xgen().

                                                        {
  return xgen (GEN_ACCESS, comma (f, args)); }
syntactic xderive ( const syntactic g,
const syntactic v 
)

Definition at line 456 of file syntactic.cpp.

References GEN_XDERIVE, and syn().

                                                           {
  return syn (GEN_XDERIVE, g, v); }
syntactic xderive ( const syntactic g)

Definition at line 454 of file syntactic.cpp.

References GEN_XDERIVE, and syn().

Referenced by xderive_op::op(), and xderive_op::set_op().

                                       {
  return syn (GEN_XDERIVE, g); }
xgcd_matrix<generic> mmx::xgcd ( const generic &  x1,
const generic &  x2 
)

Referenced by xgcd_op::op(), and xgcd_op::set_op().

syntactic xgcd ( const syntactic g1,
const syntactic g2 
)

Definition at line 387 of file syntactic.cpp.

References exact_eq(), GEN_ROW, GEN_SQTUPLE, and syn().

                                                          {
  if (exact_eq (g1, 0))
    return exact_eq (g2, 0) ?
      syn (GEN_SQTUPLE, syn (GEN_ROW, 1, 0     ), syn (GEN_ROW, 0, 1)) :
      syn (GEN_SQTUPLE, syn (GEN_ROW, 0, 1 / g2), syn (GEN_ROW, 1, 0));
  return exact_eq (g2, 0) ?
    syn (GEN_SQTUPLE, syn (GEN_ROW, 1 / g1, 0), syn (GEN_ROW, 0  , 1 )) :
    syn (GEN_SQTUPLE, syn (GEN_ROW, 1 / g1, 0), syn (GEN_ROW, -g2, g1));
}
generic xgen ( const generic f,
const generic args 
)

Definition at line 162 of file generic.cpp.

References vector_to_compound(), and xgen_sub().

Referenced by xaccess(), xrow(), xsqtuple(), and xtuple().

                                             {
  vector<generic> v;
  v << f;
  xgen_sub (v, args);
  return vector_to_compound (v);
}
void mmx::xgen_sub ( vector< generic > &  v,
const generic g 
)

Definition at line 152 of file generic.cpp.

References exact_eq(), GEN_COMMA, n, and N().

Referenced by xgen().

                                                {
  if (is<compound> (g) && N(g) >= 1 && exact_eq (g[0], GEN_COMMA)) {
    int i, n= N(g);
    for (i=1; i<n; i++)
      xgen_sub (v, g[i]);
  }
  else v << g;
}
generic xrow ( const generic args)

Definition at line 179 of file generic.cpp.

References GEN_ROW, and xgen().

                                {
  return xgen (GEN_ROW, g); }
generic xsqtuple ( const generic args)
Examples:
generic_test.cpp.

Definition at line 177 of file generic.cpp.

References GEN_SQTUPLE, and xgen().

Referenced by trig_op::op(), and trig().

                                    {
  return xgen (GEN_SQTUPLE, g); }
generic xtuple ( const generic args)

Definition at line 175 of file generic.cpp.

References GEN_TUPLE, and xgen().

                                  {
  return xgen (GEN_TUPLE, g); }
scalar_type_helper< T >::val mmx::zero_scalar ( const T &  y) [inline]

Definition at line 482 of file type_props.hpp.

References promote_scalar().

                         {
  return promote_scalar ((int) 0, y);
}

Variable Documentation

table<C,T,V> ADDITIVE_SCALAR_INT_SUGAR(template< typename C, typename T, typename V >, table< C, T, V >) STRICT_COMPARE_SUGAR(template< typename C
char* alloc_mem
size_t alloc_remains
char alloc_table[(256+sizeof(void *))]
string(* as_string_hook)(double x) = NULL

Definition at line 160 of file string.cpp.

Referenced by as_string().

Definition at line 20 of file source_track.cpp.

Referenced by source_exception().

Definition at line 55 of file generic.cpp.

Referenced by attach_generic_binary_reader(), and binary_read_generic().

size_t bytes_in_use = 0

Referenced by mmx_used_bytes().

C
Examples:
vector_test.cpp.

Definition at line 157 of file table.hpp.

Referenced by _mul_add(), accuracy_cst(), append(), big(), binary_map(), binary_map_optimized(), binary_map_scalar(), binpow(), bit_size(), catalan_cst(), cons(), copy(), invert_op::def(), binary_helper< symbol< C, V > >::disassemble(), euler_cst(), extract(), extract_mod(), fill(), binary_helper< vector< C, V > >::full_type_name(), binary_helper< table< C, T, V > >::full_type_name(), binary_helper< symbol< C, V > >::full_type_name(), binary_helper< sparse_vector< C, T, V > >::full_type_name(), binary_helper< list< C > >::full_type_name(), binary_helper< iterator< C > >::full_type_name(), binary_helper< heap< C > >::full_type_name(), binary_helper< chain< C > >::full_type_name(), fuzz_cst(), imaginary_cst(), INDIRECT_IMPL_1(), infinity_cst(), insert(), is_reliable(), largest_cst(), list< cleaner >::list(), log2_cst(), make_literal(), map(), maximal_cst(), minimal_cst(), mmx_classical_delete(), mmx_classical_new(), mmx_delete(), mmx_new(), nan_cst(), min_precision_op::neutral(), max_magnitude_op::neutral(), max_exponent_op::neutral(), sup_op::neutral(), inf_op::neutral(), max_op::neutral(), min_op::neutral(), lcm_op::neutral(), gcd_op::neutral(), prem_op::op(), lmul_op::op_mod(), rmul_op::op_mod(), mul_op::op_mod(), sub_op::op_mod(), add_op::op_mod(), neg_op::op_mod(), basic_alias_rep< C >::open(), pi_cst(), range(), binary_helper< vector< C, V > >::read(), binary_helper< table< C, T, V > >::read(), REP_STRUCT_1(), REP_STRUCT_2(), reverse(), format< cleaner >::sample(), seq(), swap_op::set_op(), binary_helper< vector< C, V > >::short_type_name(), binary_helper< table< C, T, V > >::short_type_name(), binary_helper< symbol< C, V > >::short_type_name(), binary_helper< sparse_vector< C, T, V > >::short_type_name(), binary_helper< list< C > >::short_type_name(), binary_helper< iterator< C > >::short_type_name(), binary_helper< heap< C > >::short_type_name(), binary_helper< chain< C > >::short_type_name(), smallest_cst(), string_as_numeric(), swap(), unary_map(), fast_helper< vector< C, V > >::uu(), vec(), implementation< vector_linear, V, vector_naive >::vec_reverse(), implementation< vector_abstractions, V, vector_naive >::vec_unary_big_dicho(), implementation< vector_abstractions_stride, V, vector_naive >::vec_unary_big_stride(), vector< observer >::vector(), WRAP_INDIRECT_IMPL(), and WRAP_WRAPPED_IMPL().

Referenced by opname_table().

generic CPP_AND("and")

Referenced by is_applicable(), and opname_table().

Referenced by opname_table().

generic CPP_BEGIN("begin")

Referenced by opname_table().

Referenced by opname_table().

Referenced by opname_table().

generic CPP_BOOL_TYPE("Boolean")
generic CPP_BREAK("break")
generic CPP_CATCH("catch")

Referenced by opname_table().

generic CPP_CONST("const")
generic CPP_CONST_METHOD("const_method")
generic CPP_CONSTRUCT("construct")
generic CPP_CONSTRUCTOR("constructor")
generic CPP_CONTINUE("continue")
generic CPP_DELETE("delete")
generic CPP_DESTRUCTOR("destructor")
generic CPP_DO("do")
generic CPP_ELSE("else")
generic CPP_EXIT("exit")
generic CPP_EXTERN("extern")
generic CPP_EXTERN_C("extern_C")
generic CPP_FOR("for")
generic CPP_FRIEND("friend")

Referenced by is_function_type().

Referenced by opname_table().

Referenced by opname_table().

Referenced by opname_table().

generic CPP_IF("if")

Referenced by is_applicable().

generic CPP_INHERIT("inherit")
generic CPP_INITIALIZE("initialize")
generic CPP_INLINE("inline")

Referenced by is_function_type().

Referenced by opname_table().

Referenced by opname_table().

generic CPP_MACRO("cpp_macro")

Referenced by opname_table().

generic CPP_MMX_APPLICATION_TYPE("Mmx_application")

Referenced by opname_table().

generic CPP_NAMESPACE("namespace")
generic CPP_NEW("new")

Referenced by opname_table().

generic CPP_OR("or")

Referenced by is_applicable(), and opname_table().

Referenced by opname_table().

Referenced by opname_table().

Referenced by opname_table().

Referenced by opname_table().

generic CPP_PUBLIC("public")
generic CPP_RETURN("return")
generic CPP_SPECIALIZE("specialize")

Referenced by is_applicable().

generic CPP_STATIC("static")

Referenced by is_function_type().

generic CPP_STRUCT("struct")
generic CPP_SWITCH("switch")
generic CPP_TEMPLATE("template")
generic CPP_THROW("raise")

Referenced by opname_table().

generic CPP_TRY("try")
generic CPP_TYPE_CONSTRUCTOR("type_constructor")

Referenced by is_applicable().

generic CPP_TYPEDEF("typedef")
generic CPP_UNALIAS("unalias")

Referenced by is_applicable().

generic CPP_UNFUNCTION("unfunction")
generic CPP_UNPOINTER("unpointer")

Referenced by is_applicable().

generic CPP_USING("using")
generic CPP_VERBATIM("verbatim")
generic CPP_VIRTUAL("virtual")
generic CPP_WHILE("while")

Referenced by is_applicable().

void(* dynamic_event)(const string &id, const generic &val) = NULL

Definition at line 66 of file dynamic.cpp.

Referenced by output_observer_rep::modify().

void(* embedded_link)(const string &name) = NULL

Definition at line 66 of file dlink.cpp.

Referenced by dl_link().

bool ev_lock = false

Definition at line 56 of file evaluator.cpp.

Definition at line 31 of file source_track.cpp.

Referenced by get_file_source(), and store_file_source().

bool frac_flag = false [static]

Definition at line 241 of file syntactic.cpp.

Referenced by operator*(), operator/(), pow(), and set_frac_flag().

generic GEN_ABS("abs")

Referenced by abs(), abs_as_op::name(), and abs_op::name().

generic GEN_ACCURACY("accuracy")

Referenced by set_accuracy().

generic GEN_ALL_TYPES("all_types")

Referenced by all_type_names(), and define_type_sub().

generic GEN_ARCCOS("arccos")

Referenced by accelerate(), acos(), and acos_op::name().

generic GEN_ARCSIN("arcsin")

Referenced by accelerate(), asin(), and asin_op::name().

generic GEN_ARCTAN("arctan")

Referenced by accelerate(), atan(), and atan_op::name().

generic GEN_ARCTAN2("arctan2")

Referenced by accelerate(), atan2(), and atan2_op::name().

generic GEN_ARG("arg")

Referenced by arg(), and arg_op::name().

generic GEN_ARGCH("argch")

Referenced by accelerate(), acosh(), and acosh_op::name().

generic GEN_ARGSH("argsh")

Referenced by accelerate(), asinh(), and asinh_op::name().

generic GEN_ARGTH("argth")

Referenced by accelerate(), atanh(), and atanh_op::name().

generic GEN_ASSUME("assume")

Referenced by is_C0(), and mmx_printer::pp_E0().

generic GEN_BALL("ball")

Referenced by ball_op::name().

generic GEN_BEGIN("begin")

Referenced by is_C0(), print_mmx(), and un_try_catch().

generic GEN_BLUR("blur")

Referenced by blur_op::name().

Referenced by define_prerequisites().

generic GEN_BREAK("break")

Referenced by is_C0().

generic GEN_CACHE_CONVERTER("cache/converter")
generic GEN_CACHE_CONVERTERS("cache/converters")
generic GEN_CACHE_PENALTY("cache/penalty")

Referenced by derive().

generic GEN_CASE("case")
generic GEN_CAST("cast")

Referenced by accelerate().

generic GEN_CATALAN("mathcatalan")

Referenced by math_symbol_table(), and set_catalan().

generic GEN_CATCH("catch")
generic GEN_CATEGORY("category")

Referenced by is_C0().

generic GEN_CBRT("cbrt")

Referenced by cbrt_op::name().

generic GEN_CEIL("ceil")

Referenced by ceil(), and ceil_op::name().

generic GEN_CENTER("center")

Referenced by center(), and center_op::name().

generic GEN_CH("ch")

Referenced by accelerate(), cosh(), and cosh_op::name().

generic GEN_CLASS("class")

Referenced by is_C0().

generic GEN_CLASS_ACCESS("class/access")
generic GEN_CLASS_ENCAPSULATION("class/encapsulation")
generic GEN_CLASS_EXPORT("class/export")
generic GEN_CLASS_FIELDS("class/fields")
generic GEN_CLASS_MODE("class/mode")
generic GEN_CLASS_NAME("class/name")
generic GEN_CLOSURE("closure")
generic GEN_COERCE("coerce")

Referenced by comma(), and xgen_sub().

Referenced by define_prerequisites().

generic GEN_CONJ("conj")

Referenced by conj(), and conj_op::name().

generic GEN_CONSTANT("constant")

Referenced by is_C0().

generic GEN_CONSTRUCTOR("constructor")
generic GEN_CONTINUE("continue")

Referenced by is_C0().

Definition at line 291 of file identifiers.hpp.

Referenced by convert().

generic GEN_CONVERTER("converter")
generic GEN_CONVERTERS("converters")
generic GEN_COS("cos")

Referenced by accelerate(), cos(), and cos_op::name().

generic GEN_D("mathd")
generic GEN_DELTA("delta")

Referenced by math_symbol_table().

generic GEN_DENOMINATOR("denominator")
generic GEN_DERIVATIVE("derivative")

Referenced by math_symbol_table().

generic GEN_DERIVE("derive")

Referenced by accelerate(), derive(), and derive_op::name().

generic GEN_DESTRUCTOR("destructor")

Referenced by math_symbol_table().

generic GEN_DOWNGRADE("downgrade")
generic GEN_DOWNTO("downto")

Referenced by math_symbol_table().

generic GEN_DUPLICATE("duplicate")
generic GEN_E("mathe")

Referenced by math_symbol_table().

generic GEN_ELSE("else")
generic GEN_EQUALIZE_GROUPED("equalize_grouped")

Referenced by math_symbol_table().

generic GEN_ERF("erf")

Referenced by erf_op::name().

generic GEN_ERROR("error")
generic GEN_EULER("matheuler")

Referenced by math_symbol_table(), and set_euler().

generic GEN_EXACT_EQ("exact_eq")

Referenced by exact_eq_op::name().

generic GEN_EXACT_HASH("exact_hash")

Referenced by exact_hash_op::name().

generic GEN_EXACT_NEQ("exact_neq")

Referenced by exact_neq_op::name().

generic GEN_EXISTS("exists")

Referenced by is_C0(), and mmx_printer::pp_E0().

generic GEN_EXP("exp")

Referenced by accelerate(), exp(), and exp_op::name().

generic GEN_EXP10("exp10")

Referenced by exp10_op::name().

generic GEN_EXP2("exp2")

Referenced by exp2_op::name().

generic GEN_EXPECTED("expected")
generic GEN_EXPONENT("exponent")

Referenced by exponent(), and exponent_op::name().

generic GEN_EXPORT("export")
generic GEN_EXTERN("extern")

Referenced by is_C0().

generic GEN_FALSE("false")

Referenced by define_prerequisites().

generic GEN_FAST("fast")

Referenced by fast_op::name().

generic GEN_FLOOR("floor")

Referenced by floor(), and floor_op::name().

generic GEN_FOR("for")
generic GEN_FORALL("forall")

Referenced by is_C0(), and mmx_printer::pp_E0().

generic GEN_FOREIGN("foreign")

Referenced by is_C0().

generic GEN_FUZZ("Fuzz")

Referenced by set_fuzz().

generic GEN_GAMMA("gamma")

Referenced by gamma_op::name().

generic GEN_GAUSSIAN("gaussian")

Referenced by gaussian_op::name().

generic GEN_GCD("gcd")

Referenced by gcd(), and gcd_op::name().

generic GEN_GENERATE("generate")
generic GEN_GLOBAL("global")
generic GEN_GRAD("grad")
generic GEN_GRAEFFE("graeffe")

Referenced by graeffe_op::name().

generic GEN_HARD_EQ("hard_eq")

Referenced by hard_eq_op::name().

generic GEN_HARD_GTR("hard_gtr")

Referenced by hard_gtr_op::name().

generic GEN_HARD_HASH("hard_hash")

Referenced by hard_hash_op::name().

generic GEN_HARD_LESS("hard_less")

Referenced by hard_less_op::name().

generic GEN_HARD_NEQ("hard_neq")

Referenced by hard_neq_op::name().

generic GEN_HASH("hash")

Referenced by hash_op::name().

generic GEN_HYPOT("hypot")

Referenced by accelerate(), hypot(), and hypot_op::name().

generic GEN_I("mathi")

Referenced by math_symbol_table(), and set_imaginary().

generic GEN_IDENTITY("identity")

Referenced by compose(), and id_op::name().

generic GEN_IF("if")

Referenced by is_C0().

generic GEN_IM("Im")

Referenced by Im(), and Im_op::name().

Referenced by math_symbol_table().

generic GEN_IMPORT("import")
generic GEN_IN("in")

Referenced by math_symbol_table().

Referenced by inf_op::name().

generic GEN_INFIX("infix")
generic GEN_INLINE("inline")
generic GEN_INPLACE("inplace")
generic GEN_INTERN("intern")

Referenced by is_C0().

generic GEN_INTERVAL("interval")

Referenced by interval_op::name().

generic GEN_INVERT("invert")

Referenced by accelerate(), and invert_op::name().

generic GEN_KEYWORD("keyword")
generic GEN_LAMBDA("lambda")

Referenced by is_C0().

generic GEN_LARGEST("largest")

Referenced by set_largest().

generic GEN_LCM("lcm")

Referenced by lcm(), and lcm_op::name().

generic GEN_LIFT("lift")

Referenced by lift_op::name().

generic GEN_LIST("list")

Referenced by define_prerequisites().

generic GEN_LOCAL("local")
generic GEN_LOG("log")

Referenced by accelerate(), log(), and log_op::name().

generic GEN_LOG10("log10")

Referenced by log10_op::name().

generic GEN_LOG2("log2")

Referenced by log2_op::name().

generic GEN_LOG2_AS("set_log2")
generic GEN_LOOP("loop")

Referenced by is_C0().

generic GEN_LOWER("lower")

Referenced by lower_op::name().

generic GEN_MACRO("macro")

Referenced by is_C0().

generic GEN_MAGNITUDE("magnitude")

Referenced by magnitude(), and magnitude_op::name().

Referenced by math_symbol_table().

generic GEN_MAX("max")

Referenced by max(), and max_op::name().

generic GEN_METHOD("method")

Referenced by is_C0().

generic GEN_MIN("min")

Referenced by min(), and min_op::name().

generic GEN_MODULE("module")

Referenced by is_C0().

generic GEN_MUL_SUB("mul_sub")

Referenced by mul_sub_op::name().

generic GEN_MUTABLE("mutable")

Referenced by is_C0().

generic GEN_NAN("NaN")

Referenced by set_nan().

generic GEN_NEW("new")

Referenced by define_constructor().

generic GEN_NEXT_ABOVE("next_above")

Referenced by next_above().

generic GEN_NEXT_BELOW("next_below")

Referenced by next_below().

generic GEN_NIL("nil")

Referenced by flatten().

generic GEN_NOOP("noop")

Referenced by no_op::set_name().

Referenced by math_symbol_table().

generic GEN_NUMERATOR("numerator")

Referenced by numerator_op::name(), and numerator().

generic GEN_OPERATOR("operator")
generic GEN_OR("\\/")

Referenced by math_symbol_table(), and operator|().

generic GEN_PARTIAL("partial")

Referenced by math_symbol_table().

generic GEN_PENALTY("penalty")

Referenced by is_C0(), and mmx_printer::pp_E0().

generic GEN_PI("mathpi")

Referenced by math_symbol_table(), and set_pi().

generic GEN_POLAR("polar")

Referenced by polar_op::name().

generic GEN_POSTFIX("postfix")
generic GEN_PRECISION("precision")

Referenced by precision_op::name(), and precision().

generic GEN_PREFIX("prefix")

Referenced by math_symbol_table().

generic GEN_PRIVATE("private")

Referenced by is_C0().

generic GEN_PROJECT("project")

Referenced by project_op::name().

generic GEN_PUBLIC("public")

Referenced by is_C0().

generic GEN_QUO("quo")
generic GEN_RADIUS("radius")

Referenced by radius_op::name(), and radius().

generic GEN_RAISE("raise")

Referenced by math_symbol_table().

generic GEN_RE("Re")

Referenced by Re_op::name(), and Re().

generic GEN_REM("rem")
generic GEN_RETURN("return")

Referenced by is_C0().

generic GEN_REVERSE("reverse")

Referenced by reverse_op::name().

generic GEN_ROUND("round")

Referenced by round_op::name(), and round().

Referenced by define_prerequisites().

Referenced by math_symbol_table().

Referenced by math_symbol_table().

Referenced by math_symbol_table().

generic GEN_SH("sh")

Referenced by accelerate(), sinh_op::name(), and sinh().

generic GEN_SHARPEN("sharpen")

Referenced by sharpen_op::name().

generic GEN_SIN("sin")

Referenced by accelerate(), sin_op::name(), and sin().

Referenced by math_symbol_table().

generic GEN_SLOW("slow")

Referenced by slow_op::name().

generic GEN_SMALLEST("smallest")

Referenced by set_smallest().

generic GEN_SOLVE("solve")

Referenced by solve().

generic GEN_SPECIALIZE_ALIAS("specialize_alias")
generic GEN_SQRT("sqrt")

Referenced by accelerate(), sqrt_op::name(), pow(), and sqrt().

generic GEN_SQUARE("square")

Referenced by accelerate(), and square_op::name().

generic GEN_STEP("step")
generic GEN_SUBSTITUTE("substitute")

Referenced by substitute().

Referenced by sup_op::name().

generic GEN_TAN("tan")

Referenced by accelerate(), tan_op::name(), and tan().

generic GEN_TH("th")

Referenced by accelerate(), tanh_op::name(), and tanh().

generic GEN_THIS("this")
generic GEN_TO("to")

Referenced by math_symbol_table().

generic GEN_TRANSITIVE("transitive")
generic GEN_TRUE("true")

Referenced by define_prerequisites().

generic GEN_TRUNC("trunc")

Referenced by trunc_op::name(), and trunc().

generic GEN_TRY("try")

Referenced by is_C0().

generic GEN_TYPE_ID("type_id")

Referenced by define_type_sub(), and type_id().

generic GEN_TYPE_NAME("type_name")

Referenced by define_type_sub(), and type_name().

generic GEN_UNSPECIFIED_TYPE("Unspecified")

Referenced by type_name().

generic GEN_UNTIL("until")
generic GEN_UPGRADE("upgrade")
generic GEN_UPPER("upper")

Referenced by upper_op::name().

generic GEN_VIA_TUPLE("via_tuple")

Referenced by math_symbol_table().

Referenced by math_symbol_table().

generic GEN_WHILE("while")
generic GEN_XDERIVE("xderive")

Referenced by xderive_op::name(), and xderive().

generic GEN_XGCD("xgcd")
generic GEN_XOR("xor")

Referenced by math_symbol_table().

generic GEN_YIELD("yield")
generic GEN_ZETA("zeta")

Referenced by zeta_op::name().

table<void (*) (), string> glue_table)() [static]

Definition at line 108 of file glue.cpp.

Referenced by call_glue(), and register_glue().

                                                 {
  static table<void (*) (), string> t;
  return t;
}
triple<C1,C2,C3> HARD_IDENTITY_OP_SUGAR(template< typename C1, typename C2, typename C3 >, triple< C1, C2, C3 >) template< typename C1
static nat indentation_level = 0 [static]

Definition at line 190 of file cpp_printer.cpp.

Referenced by cpp_printer::cpp_printer(), and operator<<().

bool math_mode = false

Definition at line 21 of file port.cpp.

Referenced by output_as_mmx().

port mmin = input_file_port (stdin , false, "mmin")

Definition at line 91 of file file_port.cpp.

Referenced by glue_port().

bool mmx_abbreviate_coerce = true

Definition at line 23 of file mmx_printer.cpp.

int mmx_argc

Definition at line 22 of file basix.cpp.

char ** mmx_argv

Definition at line 23 of file basix.cpp.

Definition at line 58 of file dynamic.hpp.

Referenced by argument_observer(), output_observer(), and result_observer().

table< int, int > out_count
S1

Definition at line 151 of file function.hpp.

Referenced by map().

S2

Definition at line 244 of file function.hpp.

S3

Definition at line 296 of file function.hpp.

S4

Definition at line 348 of file function.hpp.

S5

Definition at line 400 of file function.hpp.

S6

Definition at line 452 of file function.hpp.

S7

Definition at line 504 of file function.hpp.

S8

Definition at line 556 of file function.hpp.

Definition at line 157 of file table.hpp.

Definition at line 58 of file evaluator.cpp.

Referenced by restore_evaluator(), and select_evaluator().

vector<C,V> STRICT_COMPARE_SUGAR(template< typename C, typename V >, vector< C, V >) ARITH_SCALAR_INT_SUGAR(template< typename C

Definition at line 86 of file system.cpp.

table< C, T, V >

Definition at line 157 of file table.hpp.

bool texmacs_mode = false

Definition at line 20 of file port.cpp.

string texmacs_pending = "" [static]

Definition at line 33 of file mmx_texmacs.cpp.

Referenced by texmacs_command(), and texmacs_flush_commands().

bool the_series_expr = false

Definition at line 496 of file syntactic.cpp.

Definition at line 494 of file syntactic.cpp.

Definition at line 495 of file syntactic.cpp.

const bool threads_active = false [static]

Definition at line 97 of file fast_new.hpp.

Referenced by mmx_free(), mmx_malloc(), and mmx_realloc().

Definition at line 216 of file threads.cpp.

vector< C, V > V

Definition at line 168 of file sparse_vector.hpp.

Referenced by default_aligned_size(), and solve_vector_lde_op::diff_op().

vector<C,V> vector< C, V >

Definition at line 1078 of file vector.hpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines