CS代写 tnt_fortran_array3d_utils.h Source File

tnt_fortran_array3d_utils.h Source File

Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   File Members  

Copyright By PowCoder代写 加微信 powcoder

tnt_fortran_array3d_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_ARRAY3D_UTILS_H
00022 #define TNT_FORTRAN_ARRAY3D_UTILS_H
00024 #include
00025 #include
00027 namespace TNT
00038 template
00039 std::ostream& operator<<(std::ostream &s, const Fortran_Array3D &A)
00041 int M=A.dim1();
00042 int N=A.dim2();
00043 int K=A.dim3();
00045 s << M << " " << N << " " << K << "\n"; 00047 for (int i=1; i<=M; i++) 00048 { 00049 for (int j=1; j<=N; j++) 00050 { 00051 for (int k=1; k<=K; k++) 00052 s << A(i,j,k) << " "; 00053 s << "\n"; 00054 } 00055 s << "\n"; 00056 } 00059 return s; 00078 template
00079 std::istream& operator>>(std::istream &s, Fortran_Array3D &A)
00082 int M, N, K;
00084 s >> M >> N >> K;
00086 Fortran_Array3D B(M,N,K);
00088 for (int i=1; i<=M; i++) 00089 for (int j=1; j<=N; j++) 00090 for (int k=1; k<=K; k++) 00091 s >> B(i,j,k);
00093 A = B;
00094 return s;
00100 } // namespace TNT
00102 #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