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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tnt_fortran_array2d.h

?? fast marching method
?? H
字號:
/*
*
* Template Numerical Toolkit (TNT): Two-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_ARRAY2D_H
#define TNT_FORTRAN_ARRAY2D_H

#include <cstdlib>
#include <iostream>

#ifdef TNT_BOUNDS_CHECK
#include <assert.h>
#endif

#include "tnt_array2d.h"

namespace TNT
{

/**
	Templated two-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) notation and A(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_Array2D 
{


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

  public:

    typedef         T   value_type;

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


};

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


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



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

	<p>
	This version avoids the O(m*n) 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.
*/
template <class T>
Fortran_Array2D<T>::Fortran_Array2D(int m, int n) : A_(n,m) {}



/**
	Create a new (m x n ) 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 val the constant value to set all elements of the new array to.
*/
template <class T>
Fortran_Array2D<T>::Fortran_Array2D(int m, int n, const T &val) : A_(n, m, val) {}


/**

	Create a new (m x n) 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_Array2D class.


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




/**
	Elements are accessed via A(i,j) 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_Array2D<T>::operator()(int i, int j) 
{ 
#ifdef TNT_BOUNDS_CHECK
	assert(j >= 1);
	assert(j <= A_.dim1());
	assert(i >= 1);
	assert(i <= A_.dim2());
#endif

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

}

/**
	Read-only version of A(i,j) 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_Array2D<T>::operator()(int i, int j)  const
{ 
#ifdef TNT_BOUNDS_CHECK
	assert(j >= 1);
	assert(j <= A_.dim1());
	assert(i >= 1);
	assert(i <= A_.dim2());
#endif

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

}


/**
	Assign all elemnts of A to a constant scalar.
*/
template <class T>
Fortran_Array2D<T> & Fortran_Array2D<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_Array2D B(A.copy()), 
	to create a new array that does not share data.

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

	Fortran_Array2D 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_Array2D A(m,n);
	Fortran_Array2D C(m,n);
	Fortran_Array2D 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_Array2D<T> & Fortran_Array2D<T>::inject(const Fortran_Array2D &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_Array2D<T> & Fortran_Array2D<T>::ref(const Fortran_Array2D<T> &A)
{
	A_.ref(A.A_);
	return *this;
}

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

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

/**
	@return the size of the second dimension of the array.
*/
template <class T>
inline int Fortran_Array2D<T>::dim2() 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_Array2D<T>::ref_count() const { return A_.ref_count(); }

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




} /* namespace TNT */

#endif
/* TNT_FORTRAN_ARRAY2D_H */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
石原莉奈在线亚洲二区| 国产真实乱对白精彩久久| 国产精品自在欧美一区| 欧美一区二区在线视频| 亚洲成人自拍网| 欧美乱妇20p| 日韩国产高清在线| 欧美一区二区网站| 日韩av中文字幕一区二区三区| 欧美三区在线视频| 日韩国产精品大片| 久久午夜电影网| av网站免费线看精品| 亚洲精品美腿丝袜| 日韩午夜三级在线| 国产白丝网站精品污在线入口| 中文字幕精品一区| 色av成人天堂桃色av| 日韩av网站免费在线| 久久色成人在线| 色婷婷国产精品| 日韩主播视频在线| 久久久精品综合| 91亚洲男人天堂| 亚洲成人一二三| 国产欧美一区二区精品忘忧草| 99精品久久久久久| 六月丁香综合在线视频| 中文字幕中文字幕中文字幕亚洲无线| 一本色道久久综合狠狠躁的推荐| 免费久久99精品国产| 中文字幕在线视频一区| 精品国产一区二区三区忘忧草| 成人久久视频在线观看| 蜜臀av性久久久久蜜臀aⅴ流畅| 亚洲欧美偷拍三级| 国产欧美日韩另类一区| 欧美一区二区在线免费播放| 一本一道久久a久久精品综合蜜臀| 日本强好片久久久久久aaa| 一区二区久久久久久| 中文字幕不卡三区| 国产日产亚洲精品系列| 欧美猛男gaygay网站| 国产裸体歌舞团一区二区| 亚洲国产精品一区二区www在线| 欧美激情综合五月色丁香小说| 精品美女被调教视频大全网站| 欧美午夜精品一区| 欧美久久一区二区| 欧美久久久久久蜜桃| 欧美精品99久久久**| 欧美日本乱大交xxxxx| 欧美三级在线看| 日韩西西人体444www| 国产日韩欧美电影| 国产精品欧美一区二区三区| 亚洲丝袜精品丝袜在线| 亚洲欧美日韩小说| 一区二区三区在线播| 亚洲高清免费一级二级三级| 午夜国产精品影院在线观看| 精品亚洲国产成人av制服丝袜| 国产一区二区女| 色诱视频网站一区| 在线综合视频播放| 欧美激情一区二区三区四区| 夜夜夜精品看看| 久久er精品视频| 波多野结衣中文字幕一区二区三区 | www.日韩大片| 日韩免费看的电影| 亚洲国产精品99久久久久久久久| 一区二区日韩电影| 美女国产一区二区三区| 99这里都是精品| 日韩一区二区三区视频在线观看| 18欧美亚洲精品| 国产一区二区成人久久免费影院| 色综合咪咪久久| 中文字幕免费一区| 麻豆精品久久精品色综合| 色猫猫国产区一区二在线视频| 欧美v国产在线一区二区三区| 亚洲一区在线免费观看| 国产成人综合网| xnxx国产精品| 日本免费在线视频不卡一不卡二 | 国产精品99久| 日韩你懂的在线观看| 香蕉乱码成人久久天堂爱免费| 99视频有精品| 中文字幕在线观看一区二区| 国产美女视频一区| 精品国产一区久久| 极品尤物av久久免费看| 久久久精品综合| 激情国产一区二区 | 成人精品电影在线观看| 337p粉嫩大胆噜噜噜噜噜91av| 日韩—二三区免费观看av| 色成人在线视频| 亚洲v中文字幕| 制服丝袜成人动漫| 91啪亚洲精品| 亚洲福利视频一区| 日韩一区二区在线看片| 麻豆91在线看| 欧美激情一区在线观看| 成人av综合一区| 一区二区三区免费在线观看| 欧美福利视频导航| 国产乱淫av一区二区三区| 久久精品一区蜜桃臀影院| 91麻豆高清视频| 天堂久久一区二区三区| 久久综合精品国产一区二区三区| 国产精品综合av一区二区国产馆| 亚洲人吸女人奶水| 日韩欧美一区在线观看| av亚洲精华国产精华精华| 亚洲国产精品自拍| 国产精品久久久久桃色tv| 欧美日韩国产一级| 国产99久久久久久免费看农村| 夜夜操天天操亚洲| 日本一区二区三区免费乱视频| 欧美性欧美巨大黑白大战| 国产在线精品国自产拍免费| 一区二区三区日本| 国产喷白浆一区二区三区| 欧美午夜精品一区二区蜜桃| 国产jizzjizz一区二区| 奇米色一区二区三区四区| 亚洲主播在线观看| 国产午夜精品理论片a级大结局| 欧美性xxxxx极品少妇| 成人少妇影院yyyy| 国产在线乱码一区二区三区| 视频一区二区三区在线| 亚洲在线免费播放| 亚洲国产日韩一级| 亚洲一区二区三区四区不卡| 一区二区三区日韩精品视频| 成人免费在线视频观看| 国产精品美女久久久久久久网站| 久久久99久久精品欧美| 中文字幕国产一区二区| 亚洲国产精品成人综合色在线婷婷 | 国产精品美女久久久久高潮| 久久久久久亚洲综合| 欧美成人伊人久久综合网| 欧美一区日本一区韩国一区| 日韩欧美中文字幕精品| 精品99一区二区| 亚洲日本va午夜在线电影| 亚洲视频 欧洲视频| 亚洲男同1069视频| 亚洲国产aⅴ天堂久久| 日韩精品午夜视频| 91在线播放网址| 精品久久久久久久久久久久久久久久久 | 欧美自拍丝袜亚洲| 99综合影院在线| 欧美日韩国产一级| 久久久久久久久久久电影| 亚洲视频一区二区在线观看| 亚洲成在人线在线播放| 国产精品一线二线三线精华| thepron国产精品| 欧美一区二区三区播放老司机| 26uuu亚洲| 日韩和欧美一区二区| 99综合电影在线视频| www久久久久| 亚洲线精品一区二区三区八戒| 蜜桃久久av一区| 欧美视频日韩视频| 中文字幕一区二区三区四区| 蜜桃av噜噜一区| 欧美精品乱码久久久久久| 日韩一区有码在线| 成人永久看片免费视频天堂| 日韩午夜在线观看视频| 午夜精品久久久久久| 欧美网站大全在线观看| 亚洲少妇最新在线视频| av日韩在线网站| 亚洲天堂av一区| 91蜜桃婷婷狠狠久久综合9色| 中文字幕免费观看一区| 国产成人亚洲精品青草天美 | 欧美日韩国产影片| 亚洲成人综合在线| 欧美久久久一区| 日本vs亚洲vs韩国一区三区二区| 91精品国产福利| 久久er精品视频| 国产精品视频一区二区三区不卡| 不卡av电影在线播放|