src/GamIO/FrameMaker.cc
/*****************************************************************
**								**
** 		 FrameMaker Table Generator 			**
**								**
** Author	: SOSI 						**
** Description  : Takes a matrix from input and attempts to	**
**		  produce a FrameMaker file a table of the	**
**		  matrix elements.				**
**								**
*****************************************************************/


Author : SOSI
Description  : Takes a matrix from input and attempts to
produce a FrameMaker file a table of the
matrix elements.
Author : SOSI Description : Takes a matrix from input and attempts to produce a FrameMaker file a table of the matrix elements .
void FM_Mat_Tbl(const std::string& filename, const matrix& mx, double threshold)
  {
  int mxr = mx.rows(); 				
  int mxc = mx.cols(); 				
  std::ofstream out(filename.c_str());		
  FM_Begin(out);				
  FM_Tbl_Begin(out);				
  out << " <TblTag `Format A'>\n";		
  out << Gform(" <TblNumColumns %d>\n", mxc);	
  FM_Tbl_Title(out);				
  FM_TblBody_Begin(out);			
  double x;
  for(int i=0; i<mxr; i++)
    {
    out << "  <Row \n";				
    for(int j=0; j<mxc; j++)
      {
      x = mx.getRe(i,j);			
      out << "   <Cell \n";			
      out << "    <CellContent \n";		
      out << "     <Para \n";			
      out << "      <PgfTag `CellHeading'> \n";	 Type
      out << "      <ParaLine \n";
      out << "      <String `" << x << "'> \n";	
      out << "      > \n";			
      out << "     > # end of Para\n";		 End fo Cell Paragraph
      out << "    > # end of CellContent\n";	 End Cell Contents
      out << "   > # end of Cell \n";		 End of Table Cell
      }
    out << "  > # end of Row\n";		 End Table Row
    }
  FM_TblBody_End(out);				 End Table Body
  FM_Tbl_End(out);				 End Table, # 1
  FM_TextFlow_Set(out);				 Begin Text Flow
  FM_Paragraph_Set(out);			 Begin Paragraph
  out << "  <ATbl 1>\n";			 Reference Table #1
  FM_Paragraph_End(out);			 End Paragraph
  FM_TextFlow_End(out);				 End of Text Flow
  FM_End(out);					 Terminate MIF
 threshold = 0;					 Compiler likes this used
 }
void FM_Mat_Tbl ( const std :: string & filename , const matrix & mx , double threshold ) { int mxr = mx . rows ( ) ; int mxc = mx . cols ( ) ; std :: ofstream out ( filename . c_str ( ) ) ; FM_Begin ( out ) ; FM_Tbl_Begin ( out ) ; out << " \n " ; out << Gform ( " \n " , mxc ) ; FM_Tbl_Title ( out ) ; FM_TblBody_Begin ( out ) ; double x ; for ( int i = 0 ; i < mxr ; i ++ ) { out << " \n " ; for ( int j = 0 ; j < mxc ; j ++ ) { x = mx . getRe ( i , j ) ; out << " \n " ; out << " \n " ; out << " \n " ; out << " \n " ; out << " \n " ; out << " " << x << " \n " ; out << " \n " ; out << " \n " ; out << " \n " ; out << " \n " ; } out << " \n " ; } FM_TblBody_End ( out ) ; FM_Tbl_End ( out ) ; FM_TextFlow_Set ( out ) ; FM_Paragraph_Set ( out ) ; out << " \n " ; FM_Paragraph_End ( out ) ; FM_TextFlow_End ( out ) ; FM_End ( out ) ; threshold = 0 ; }
FrameMaker Table Generator
FrameMaker Table Generator
// Input	out       : output stream //		mx	  : matrix //		prec	  : precision, default (FM_PP) //		threshold : magnitude threshold, default (FM_PT) // Output	none      : Function is void.  Puts out the matrix //			    as a schematic graphics object // Get matrix rows // Get matrix columns // Begin output file // Title Line for MIF File // Begin Table, # 1 // Specify Table Format A // Set Table Columns // Write Table Title // Begin Table Body //int j=0; // Start Table Row // Get matrix value // Start Table Cell // Start Cell Contents // Cell Paragraph // Cell Paragraph Type // Output value  // // End fo Cell Paragraph // End Cell Contents // End of Table Cell // End Table Row // End Table Body // End Table, # 1 // Begin Text Flow // Begin Paragraph // Reference Table #1 // End Paragraph // End of Text Flow // Terminate MIF // Compiler likes this used