text: //Includes
  #include "poly2rc.c"
  
  //Declarations
  const valarray<size_t> oktypes = {1u,2u,101u,102u};
  const size_t I = 1u, O = 1u;
  size_t dim;
  
  //Description
  string descr;
  descr += "Gets reflection coeffs (RCs) from polynomials for each vec in X.\n";
  descr += "\n";
  descr += "Use -d (--dim) to give the dimension along which to operate.\n";
  descr += "Default is 0 (along cols), unless X is a row vector.\n";
  descr += "\n";
  descr += "If dim==0, then Y has size (R-1) x C.\n";
  descr += "If dim==1, then Y has size R x (C-1),\n";
  descr += "where X has size R x C.\n";
  descr += "\n";
  descr += "Examples:\n";
  descr += "$ poly2rc X -o Y \n";
  descr += "$ poly2rc X > Y \n";
  descr += "$ cat X | poly2rc > Y \n";
  
  //Argtable
  struct arg_file  *a_fi = arg_filen(nullptr,nullptr,"<file>",I-1,I,"input file (X)");
  struct arg_int    *a_d = arg_intn("d","dim","<uint>",0,1,"dimension along which to operate [default=0]");
  struct arg_file  *a_fo = arg_filen("o","ofile","<file>",0,O,"output file (Y)");
  
  //Get options
  
  //Get dim
  if (a_d->count==0) { dim = (i1.R==1u) ? 1u : 0u; }
  else if (a_d->ival[0]<0) { cerr << progstr+": " << __LINE__ << errstr << "dim must be nonnegative" << endl; return 1; }
  else { dim = size_t(a_d->ival[0]); }
  if (dim!=0 && dim!=1) { cerr << progstr+": " << __LINE__ << errstr << "dim must be 0 or 1" << endl; return 1; }
  
  //Checks
  if (i1.isempty()) { cerr << progstr+": " << __LINE__ << errstr << "input (X) found to be empty" << endl; return 1; }
  
  //Set output header info
  o1.F = i1.F; o1.T = i1.T;
  o1.R = (dim==0u) ? i1.R-1u : i1.R;
  o1.C = (dim==1u) ? i1.C-1u : i1.C;
  o1.S = i1.S; o1.H = i1.H;
  
  //Other prep
  
  //Process
  if (i1.T==1u)
  {
      float *X, *Y;
      try { X = new float[i1.N()]; }
      catch (...) { cerr << progstr+": " << __LINE__ << errstr << "problem allocating for input file (X)" << endl; return 1; }
      try { Y = new float[o1.N()]; }
      catch (...) { cerr << progstr+": " << __LINE__ << errstr << "problem allocating for output file (Y)" << endl; return 1; }
      try { ifs1.read(reinterpret_cast<char*>(X),i1.nbytes()); }
      catch (...) { cerr << progstr+": " << __LINE__ << errstr << "problem reading input file (X)" << endl; return 1; }
      if (codee::poly2rc_s(Y,X,i1.R,i1.C,i1.S,i1.H,i1.iscolmajor(),dim))
      { cerr << progstr+": " << __LINE__ << errstr << "problem during function call" << endl; return 1; }
      if (wo1)
      {
          try { ofs1.write(reinterpret_cast<char*>(Y),o1.nbytes()); }
          catch (...) { cerr << progstr+": " << __LINE__ << errstr << "problem writing output file (Y)" << endl; return 1; }
      }
      delete[] X; delete[] Y;
  }
  else if (i1.T==101u)
  {
      float *X, *Y;
      try { X = new float[2u*i1.N()]; }
      catch (...) { cerr << progstr+": " << __LINE__ << errstr << "problem allocating for input file (X)" << endl; return 1; }
      try { Y = new float[2u*o1.N()]; }
      catch (...) { cerr << progstr+": " << __LINE__ << errstr << "problem allocating for output file (Y)" << endl; return 1; }
      try { ifs1.read(reinterpret_cast<char*>(X),i1.nbytes()); }
      catch (...) { cerr << progstr+": " << __LINE__ << errstr << "problem reading input file (X)" << endl; return 1; }
      if (codee::poly2rc_c(Y,X,i1.R,i1.C,i1.S,i1.H,i1.iscolmajor(),dim))
      { cerr << progstr+": " << __LINE__ << errstr << "problem during function call" << endl; return 1; }
      if (wo1)
      {
          try { ofs1.write(reinterpret_cast<char*>(Y),o1.nbytes()); }
          catch (...) { cerr << progstr+": " << __LINE__ << errstr << "problem writing output file (Y)" << endl; return 1; }
      }
      delete[] X; delete[] Y;
  }
  
  //Finish
  