tnt_fortran_array2d_utils.h Source File
Main Page Namespace List Compound List File List Namespace Members Compound Members File Members
Copyright By PowCoder代写 加微信 powcoder
tnt_fortran_array2d_utils.h
Go to the documentation of this file.00001 /*
00003 * Template Numerical Toolkit (TNT)
00005 * Mathematical and Computational Sciences Division
00006 * National Institute of Technology,
00007 * Gaithersburg, MD USA
00010 * This software was developed at the National Institute of Standards and
00011 * Technology (NIST) by employees of the Federal Government in the course
00012 * of their official duties. Pursuant to title 17 Section 105 of the
00013 * United States Code, this software is not subject to copyright protection
00014 * and is in the public domain. NIST assumes no responsibility whatsoever for
00015 * its use by other parties, and makes no guarantees, expressed or implied,
00016 * about its quality, reliability, or any other characteristic.
00021 #ifndef TNT_FORTRAN_ARRAY2D_UTILS_H
00022 #define TNT_FORTRAN_ARRAY2D_UTILS_H
00024 #include
00026 namespace TNT
00037 template
00038 std::ostream& operator<<(std::ostream &s, const Fortran_Array2D
00040 int M=A.dim1();
00041 int N=A.dim2();
00043 s << M << " " << N << "\n";
00045 for (int i=1; i<=M; i++)
00046 {
00047 for (int j=1; j<=N; j++)
00048 {
00049 s << A(i,j) << " ";
00050 }
00051 s << "\n";
00052 }
00055 return s;
00074 template
00075 std::istream& operator>>(std::istream &s, Fortran_Array2D
00078 int M, N;
00080 s >> M >> N;
00082 Fortran_Array2D
00084 for (int i=1; i<=M; i++)
00085 for (int j=1; j<=N; j++)
00086 {
00087 s >> B(i,j);
00088 }
00090 A = B;
00091 return s;
00097 } // namespace TNT
00099 #endif
Generated at Thu Jun 26 17:26:14 2003 for Template Numerical Toolkit (TNT) by
1.2.5 written by Dimitri van Heesch,
© 1997-2001
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com