src/Matrix/i_matrix.cc
/* These functions perform both ASCII and Binary input/output operations on an
   identity matrix.

    Function  Arguments                           Result
   ---------- ---------   -----------------------------------------------------
   print      ostream     Writes array elements in ASCII to output stream
   picture    ostream     Writes array elements pictorically to output stream
   write      ofstream    Writes array elements in Binary to output file stream
   read       ifstream    Read in array from Binary input file stream
   readASC    istream     Read in array from an input stream
   ask          ----      Interactively requests complex matrix from user

   The binary format of i_matrix data only, not size information.  The size
   is taken care of in classes matrix/_matrix and should done prior to use of
   these functions.  The data ordering is Re(<i|imx|j>, Im(<i|imx|j> columns
   then rows (i.e. row by row.)                                              */
These functions perform both ASCII and Binary input/output operations on an
identity matrix.

Function  Arguments                           Result

print      ostream     Writes array elements in ASCII to output stream
picture    ostream     Writes array elements pictorically to output stream
write      ofstream    Writes array elements in Binary to output file stream
read       ifstream    Read in array from Binary input file stream
readASC    istream     Read in array from an input stream
ask          ----      Interactively requests complex matrix from user

The binary format of i_matrix data only, not size information.  The size
is taken care of in classes matrix/_matrix and should done prior to use of
these functions.  The data ordering is Re(, Im( columns
then rows
These functions perform both ASCII and Binary input / output operations on an identity matrix . Function Arguments Result print ostream Writes array elements in ASCII to output stream picture ostream Writes array elements pictorically to output stream write ofstream Writes array elements in Binary to output file stream read ifstream Read in array from Binary input file stream readASC istream Read in array from an input stream ask ---- Interactively requests complex matrix from user The binary format of i_matrix data only not size information . The size is taken care of in classes matrix / _matrix and should done prior to use of these functions . The data ordering is Re ( Im ( columns then rows
std::vector<std::string> i_matrix::printStrings(const MxPrint& PFlgs) const
  {
  std::vector<std::string> PStrings;
  if(!PFlgs.MxAll) 			
    {					
    PStrings.push_back(std::string("1"));
    return PStrings;
    }
  int i,j;				
  std::string pline;			
  std::string z("0");
  std::string one("1");
  std::string b(" ");
  for(i=0; i<rows_; i++ )		
    {
    pline = "";
    for(j=0; j<i; j++)
      pline += z + b;
    pline += one;
    for(j++; j<rows_; j++)
      pline += b + z;
    PStrings.push_back(pline);
    }
  return PStrings;
  }
std :: vector < std :: string > i_matrix :: printStrings ( const MxPrint & PFlgs ) const { std :: vector < std :: string > PStrings ; if ( ! PFlgs . MxAll ) { PStrings . push_back ( std :: string ( " " ) ) ; return PStrings ; } int i , j ; std :: string pline ; std :: string z ( " " ) ; std :: string one ( " " ) ; std :: string b ( " " ) ; for ( i = 0 ; i < rows_ ; i ++ ) { pline = " " ; for ( j = 0 ; j < i ; j ++ ) pline += z + b ; pline += one ; for ( j ++ ; j < rows_ ; j ++ ) pline += b + z ; PStrings . push_back ( pline ) ; } return PStrings ; }
These functions perform both ASCII and Binary input/output operations on an
identity matrix.
These functions perform both ASCII and Binary input / output operations on an identity matrix .
// No unstored elems printed // So just print out 1 // Element indicies // String for array row // Loop rows