亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tnt_fortran_array3d.h.svn-base

?? fast marching method
?? SVN-BASE
字號:
/*
*
* Template Numerical Toolkit (TNT): Three-dimensional Fortran numerical array
*
* Mathematical and Computational Sciences Division
* National Institute of Technology,
* Gaithersburg, MD USA
*
*
* This software was developed at the National Institute of Standards and
* Technology (NIST) by employees of the Federal Government in the course
* of their official duties. Pursuant to title 17 Section 105 of the
* United States Code, this software is not subject to copyright protection
* and is in the public domain. NIST assumes no responsibility whatsoever for
* its use by other parties, and makes no guarantees, expressed or implied,
* about its quality, reliability, or any other characteristic.
*
*/



#ifndef TNT_FORTRAN_ARRAY3D_H
#define TNT_FORTRAN_ARRAY3D_H

#include <cstdlib>
#include <iostream>
#ifdef TNT_BOUNDS_CHECK
#include <assert.h>
#endif
#include "tnt_array3d.h"

namespace TNT
{

/**
	Templated three-dimensional, numerical array which
	looks like a conventional Fortran array.  This is 
	useful when integrating with C/C++ codes translated
	from Fortran.  Storage corresponds to conventional Fortran ordering.
	That is, the left-most dimension varies fastest.
	Indexing is via the A(i,j,k) notation and A(1,1,1)
	is the first element.
	
	<p>
	Array assignment is by reference (i.e. shallow assignment).
	That is, B=A implies that the A and B point to the
	same array, so modifications to the elements of A
	will be reflected in B. If an independent copy
	is required, then B = A.copy() can be used.  Note
	that this facilitates returning arrays from functions
	without relying on compiler optimizations to eliminate
	extensive data copying.

	<p>
	This class employs its own garbage collection via
	the use of reference counts.  That is, whenever
	an internal array storage no longer has any references
	to it, it is destoryed.
*/
template <class T>
class Fortran_Array3D 
{


  private: 


  		/* For an (mxnxk) array, we internally keep an (kxnxm) "transposed"
		   C array and access A(i,j,k) as A[k-1][j-1][i-1].  The "-1" operation
		   is inlined in a tight loop and should be easily optimized.
		*/
  		Array3D<T> A_;

  public:

    typedef         T   value_type;

	       Fortran_Array3D();
	       Fortran_Array3D(int m, int n, int k);
	       Fortran_Array3D(int m, int n, int k,  T *a);
	       Fortran_Array3D(int m, int n, int k, const T &a);
    inline Fortran_Array3D(const Fortran_Array3D &A);
	inline Fortran_Array3D & operator=(const T &a);
	inline Fortran_Array3D & operator=(const Fortran_Array3D &A);
	inline Fortran_Array3D & ref(const Fortran_Array3D &A);
	       Fortran_Array3D copy();
		   Fortran_Array3D & inject(const Fortran_Array3D & A);
	inline T& operator()(int i, int j, int k);
	inline const T& operator()(int i, int j, int k) const ;
	inline int dim1() const;
	inline int dim2() const;
	inline int dim3() const;
	inline int ref_count() const;
               ~Fortran_Array3D();


};

/**
	Create a null (0x0x0) array.  
*/
template <class T>
Fortran_Array3D<T>::Fortran_Array3D() : A_() {}


/**
	Copy constructor. Array data is NOT copied, but shared.
	Thus, in Fortran_Array3D B(A), subsequent changes to A will
	be reflected in B.  For an indepent copy of A, use
	Fortran_Array3D B(A.copy()), or B = A.copy(), instead.
*/
template <class T>
Fortran_Array3D<T>::Fortran_Array3D(const Fortran_Array3D<T> &A) : A_(A.A_) {}



/**
	Create a new (m x n x k) array, WIHOUT initializing array elements.
	To create an initialized array of constants, see Fortran_Array3D(m,n,k, value).

	<p>
	This version avoids the O(m*n*k) initialization overhead and
	is used just before manual assignment.

	@param m the first dimension of the new matrix.
	@param n the second dimension of the new matrix.
	@param k the third dimension of the new matrix.
*/
template <class T>
Fortran_Array3D<T>::Fortran_Array3D(int m, int n, int k) : A_(k,n,m) {}



/**
	Create a new (m x n x k) array,  initializing array elements to
	constant specified by argument.  Most often used to
	create an array of zeros, as in A(m, n, k, 0.0).

	@param m the first dimension of the new matrix.
	@param n the second dimension of the new matrix.
	@param k the third dimension of the new matrix.
	@param val the constant value to set all elements of the new array to.
*/
template <class T>
Fortran_Array3D<T>::Fortran_Array3D(int m, int n, int k, const T &val) : 
	A_(k, n, m, val) {}


/**
	Create a new (m x n x k) array,  as a view of an existing one-dimensional
	C array, with elements stored in <b>Fortran order</b>, i.e. right-most dimension
	varying fastest. (Often referred to as "column-major" ordering.)
	Note that the storage for this pre-existing array will
	never be garbage collected by the Fortran_Array3D class.

	@param m the first dimension of the new matrix.
	@param n the second dimension of the new matrix.
	@param k the third dimension of the new matrix.
	@param a the one dimensional C array to use as data storage for
		the array. 
*/
template <class T>
Fortran_Array3D<T>::Fortran_Array3D(int m, int n, int k, T *a) : 
	A_(k, n, m, a) {}




/**
	Elements are accessed via A(i,j,k) indexing.  
	
	If TNT_BOUNDS_CHECK macro is defined, the indices 
	are checked that they falls within the array bounds (via the
	assert() macro.) 
*/
template <class T>
inline T& Fortran_Array3D<T>::operator()(int i, int j, int k) 
{ 
#ifdef TNT_BOUNDS_CHECK
	assert(k >= 1);
	assert(k <= A_.dim1());
	assert(j >= 1);
	assert(j <= A_.dim2());
	assert(i >= 1);
	assert(i <= A_.dim3());
#endif

	return A_[k-1][j-1][i-1]; 

}

/**
	Read-only version of A(i,j,k) indexing.  
	
	If TNT_BOUNDS_CHECK macro is defined, the indices 
	are checked that they falls within the array bounds (via the
	assert() macro.) 
*/
template <class T>
inline const T& Fortran_Array3D<T>::operator()(int i, int j, int k)  const
{ 
#ifdef TNT_BOUNDS_CHECK
	assert(k >= 1);
	assert(k <= A_.dim1());
	assert(j >= 1);
	assert(j <= A_.dim2());
	assert(i >= 1);
	assert(i <= A_.dim3());
#endif

	return A_[k-1][j-1][i-1]; 

}


/**
	Assign all elemnts of A to a constant scalar.
*/
template <class T>
Fortran_Array3D<T> & Fortran_Array3D<T>::operator=(const T &a)
{
	A_ = a;
	return *this;
}
/**
	Create a new of existing matrix.  Used in B = A.copy()
	or in the construction of B, e.g. Fortran_Array3D B(A.copy()), 
	to create a new array that does not share data.

*/
template <class T>
Fortran_Array3D<T> Fortran_Array3D<T>::copy()
{

	Fortran_Array3D B;
	
	B.A_= A_.copy();
	return B;
}


/**
	Copy the elements to from one array to another, in place.
	That is B.inject(A), both A and B must conform (i.e. have
	identical dimensions).

	This differs from B = A.copy() in that references to B
	before this assignment are also affected.  That is, if
	we have 
	<pre>
	Fortran_Array3D A(m,n,k);
	Fortran_Array3D C(m,n,k);
	Fortran_Array3D B(C);        // elements of B and C are shared. 

</pre>
	then B.inject(A) affects both and C, while B=A.copy() creates
	a new array B which shares no data with C or A.

	@param A the array from elements will be copied
	@return an instance of the modifed array. That is, in B.inject(A),
	it returns B.  If A and B are not conformat, no modifications to 
	B are made.

*/
template <class T>
Fortran_Array3D<T> & Fortran_Array3D<T>::inject(const Fortran_Array3D &A)
{
	A_.inject(A.A_);

	return *this;
}





/**
	Create a reference (shallow assignment) to another existing array.
	In B.ref(A), B and A shared the same data and subsequent changes
	to the array elements of one will be reflected in the other.
	<p>
	This is what operator= calls, and B=A and B.ref(A) are equivalent
	operations.

	@return The new referenced array: in B.ref(A), it returns B.
*/
template <class T>
Fortran_Array3D<T> & Fortran_Array3D<T>::ref(const Fortran_Array3D<T> &A)
{
	A_.ref(A.A_);
	return *this;
}

/**
	B = A is shorthand notation for B.ref(A).
*/
template <class T>
Fortran_Array3D<T> & Fortran_Array3D<T>::operator=(const Fortran_Array3D<T> &A)
{
	return ref(A);
}

/**
	@return the size of the first dimension of the array.
*/
template <class T>
inline int Fortran_Array3D<T>::dim1() const { return A_.dim3(); }

/**
	@return the size of the second dimension of the array.
*/
template <class T>
inline int Fortran_Array3D<T>::dim2() const { return A_.dim2(); }

/**
	@return the size of the third (right-most) dimension of the array.
*/
template <class T>
inline int Fortran_Array3D<T>::dim3() const { return A_.dim1(); }


/**
	@return the number of arrays that share the same storage area
	as this one.  (Must be at least one.)
*/
template <class T>
inline int Fortran_Array3D<T>::ref_count() const { return A_.ref_count(); }

template <class T>
Fortran_Array3D<T>::~Fortran_Array3D()
{
}


} /* namespace TNT */

#endif
/* TNT_FORTRAN_ARRAY3D_H */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产在线观看| 欧美成人精品福利| 亚洲蜜桃精久久久久久久| 国产福利电影一区二区三区| 91精品国产一区二区人妖| 亚洲一区二区三区激情| 91福利资源站| 亚洲最大的成人av| 在线视频综合导航| 亚洲在线视频网站| 欧美伊人久久大香线蕉综合69| 亚洲精品中文在线观看| 色综合中文字幕国产| 国产麻豆一精品一av一免费 | 国产suv精品一区二区三区| 欧美电影免费观看高清完整版在线 | 亚洲成人你懂的| 欧美色综合天天久久综合精品| 亚洲天天做日日做天天谢日日欢| 成人av先锋影音| 综合久久久久久久| 91视频在线观看| 床上的激情91.| 中日韩免费视频中文字幕| 成人性生交大片免费看中文| 国产精品伦一区二区三级视频| 不卡高清视频专区| 亚洲视频在线观看一区| 91成人网在线| 日韩高清电影一区| 欧美草草影院在线视频| 国产麻豆视频一区| 国产精品视频线看| 91浏览器打开| 午夜婷婷国产麻豆精品| 欧美一区二区视频免费观看| 激情小说欧美图片| 欧美韩国日本一区| 色综合久久久久久久| 亚洲国产综合人成综合网站| 欧美精品一级二级| 国产一区二区三区久久久| 国产精品久久午夜夜伦鲁鲁| 一本大道av一区二区在线播放| 亚洲va欧美va天堂v国产综合| 91精品国产综合久久久久久 | 国产麻豆精品theporn| 欧美—级在线免费片| 色噜噜狠狠成人网p站| 午夜精品福利一区二区三区av| 日韩精品一区二区三区视频在线观看 | 成人欧美一区二区三区小说| 欧美日韩一区二区在线观看| 日本三级亚洲精品| 国产亚洲1区2区3区| 日本韩国欧美在线| www.日本不卡| 日本道精品一区二区三区| 在线观看不卡视频| 国产精品欧美久久久久无广告| 97久久人人超碰| 首页国产欧美日韩丝袜| 国产亚洲成年网址在线观看| 在线精品视频免费观看| 久久er精品视频| 中文字幕综合网| 欧美老肥妇做.爰bbww视频| 九九精品视频在线看| 17c精品麻豆一区二区免费| 欧美一区二区三区视频在线| 国产麻豆午夜三级精品| 亚洲最大成人网4388xx| 久久久久久久久蜜桃| 欧美色区777第一页| 国产乱对白刺激视频不卡| 一区二区三区中文字幕| 久久久精品综合| 欧美日韩视频在线观看一区二区三区 | 3751色影院一区二区三区| 国产99久久久久久免费看农村| 亚洲一区在线观看网站| 久久影音资源网| 欧美日韩一区 二区 三区 久久精品| 国产精品白丝jk黑袜喷水| 亚洲国产日韩a在线播放性色| 日韩高清国产一区在线| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 91免费视频大全| 精一区二区三区| 亚洲国产精品自拍| 亚洲国产精品传媒在线观看| 欧美一区二区日韩一区二区| 99久久精品情趣| 狠狠色狠狠色综合| 亚洲第一主播视频| 中文字幕在线观看一区二区| 精品国产三级电影在线观看| 欧洲日韩一区二区三区| 不卡一区二区三区四区| 极品美女销魂一区二区三区免费| 亚洲午夜激情网站| 亚洲三级免费电影| 国产精品午夜在线| 久久综合色之久久综合| 91精品国产乱码| 欧美色图片你懂的| 91污片在线观看| 顶级嫩模精品视频在线看| 精品一区二区免费视频| 日本va欧美va瓶| 亚洲成av人**亚洲成av**| 国产精品看片你懂得| 精品日韩在线观看| 91精品婷婷国产综合久久| 欧美日韩一区二区不卡| 欧美综合一区二区| 日本黄色一区二区| 色综合久久88色综合天天免费| 国产69精品久久久久毛片| 经典三级一区二区| 奇米色777欧美一区二区| 亚洲bt欧美bt精品777| 亚洲夂夂婷婷色拍ww47| 一区二区三区在线观看国产 | 精品对白一区国产伦| 欧美日韩国产首页| 欧美日韩你懂的| 欧美午夜影院一区| 欧美日韩色综合| 欧美精三区欧美精三区| 69堂亚洲精品首页| 欧美一区二区三区婷婷月色| 91麻豆精品国产91久久久更新时间| 在线观看av一区二区| 色八戒一区二区三区| 成人av电影免费在线播放| 99精品久久99久久久久| 91婷婷韩国欧美一区二区| 色综合中文字幕国产 | **欧美大码日韩| 亚洲日本欧美天堂| 亚洲女同女同女同女同女同69| 中文字幕亚洲在| 中文字幕av一区 二区| 欧美另类z0zxhd电影| 欧美高清视频一二三区| 欧美揉bbbbb揉bbbbb| 91在线小视频| 色综合一区二区三区| 色综合久久综合网欧美综合网| 99久久er热在这里只有精品66| 成人美女在线观看| 99久久精品国产网站| 91在线视频网址| 色婷婷亚洲婷婷| 欧洲中文字幕精品| 欧美一级夜夜爽| 欧美大片免费久久精品三p| 日韩精品一区二区三区视频播放 | 国产精品久久久久久久第一福利 | 中文字幕免费不卡| 国产精品日韩成人| 国产精品免费aⅴ片在线观看| 亚洲三级理论片| 亚洲已满18点击进入久久| 亚洲va欧美va天堂v国产综合| 天天色综合成人网| 国产在线精品一区二区不卡了| 国内成人自拍视频| 国产成人99久久亚洲综合精品| 高清不卡在线观看| 成人av资源站| 欧美日韩精品综合在线| 91精品欧美综合在线观看最新| 精品嫩草影院久久| 国产精品色一区二区三区| 最新不卡av在线| 亚洲日本在线天堂| 日韩—二三区免费观看av| 蜜臀av性久久久久av蜜臀妖精| 激情图片小说一区| 色综合亚洲欧洲| 9191成人精品久久| 久久久久国产一区二区三区四区| 国产蜜臀97一区二区三区| zzijzzij亚洲日本少妇熟睡| 色婷婷狠狠综合| 67194成人在线观看| 欧美精品一区二区三区在线播放| 亚洲裸体xxx| 免费视频一区二区| 丁香天五香天堂综合| 成人h动漫精品| 欧美一级在线视频| 国产精品视频yy9299一区| 亚洲第四色夜色| 国产在线不卡一区| 日本大香伊一区二区三区| 精品久久一区二区| 1024国产精品|