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

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

?? api.tex

?? 國外免費地震資料處理軟件包
?? TEX
?? 第 1 頁 / 共 2 頁
字號:
\title{Guide to RSF API}\email{sergey.fomel@beg.utexas.edu}\author{Sergey Fomel}\lefthead{Fomel}\righthead{RSF API}\maketitle\begin{abstract}  This guide explains the RSF programming interface.\end{abstract}\section{Introduction}To work with RSF files in your own programs, you may need to use anappropriate programming interface. We will demonstrate the interface indifferent languages using a simple example. The example is a clipping program.It reads and writes RSF files and accesses parameters both from the input fileand the command line. The input is processed trace by trace. This is notnecessarily the most efficient approach\footnote{Compare with the \href{http://svn.sourceforge.net/viewcvs.cgi/rsf/trunk/filt/proc/Mclip.c?view=markup}{library clip program}.} but it suffices for a simple demonstration.\section{C interface}\lstset{language=c,numbers=left,numberstyle=\tiny,showstringspaces=false}The C clip function is listed below.\lstinputlisting[frame=single]{\RSF/api/clip.c}Let us examine it in detail. \lstinputlisting[firstline=3,lastline=3,frame=single]{\RSF/api/clip.c}The include preprocessing directive is required to access the RSF interface. \lstinputlisting[firstline=9,lastline=9,frame=single]{\RSF/api/clip.c}RSF data files are defined with an abstract \texttt{sf\_file} data type. Anabstract data type means that the contents of it are not publicly declared,and all operations on \texttt{sf\_file} objects should be performed withlibrary functions. This is analogous to \texttt{FILE *} data type used in\texttt{stdio.h} and as close as C gets to an object-oriented style ofprogramming \cite[]{cbook}.\lstinputlisting[firstline=11,lastline=12,frame=single]{\RSF/api/clip.c}Before using any of the other functions, you must call\texttt{sf\_init}. This function parses the command line andinitializes an internally stored table of command-line parameters.\lstinputlisting[firstline=13,lastline=16,frame=single]{\RSF/api/clip.c}The input and output RSF file objects are created with \texttt{sf\_input} and\texttt{sf\_output} constructor functions. Both these functions take a stringargument. The string may refer to a file name or a file tag. For example, ifthe command line contains \texttt{vel=velocity.rsf}, then both\texttt{sf\_input("velocity.rsf")} and \texttt{sf\_input("vel")} areacceptable. Two tags are special: \texttt{"in"} refers to the file in thestandard input and \texttt{"out"} refers to the file in the standardoutput. \lstinputlisting[firstline=18,lastline=20,frame=single]{\RSF/api/clip.c} RSF files can store data of different types (character, integer,floating point, complex). We extract the data type of the input filewith the library \texttt{sf\_gettype} function and check if itrepresents floating point numbers. If not, the program is aborted withan error message, using the \texttt{sf\_error} function.  It isgenerally a good idea to check the input for user errors and, if theycannot be corrected, to take a safe exit.\lstinputlisting[firstline=22,lastline=26,frame=single]{\RSF/api/clip.c}Conceptually, the RSF data model is a multidimensional hypercube. Byconvention, the dimensions of the cube are stored in \texttt{n1=},\texttt{n2=}, etc. parameters. The \texttt{n1} parameter refers to thefastest axis. If the input dataset is a collection of traces,\texttt{n1} refers to the trace length. We extract it using the\texttt{sf\_histint} function (integer parameter from history) andabort if no value for \texttt{n1} is found. We could proceed in asimilar fashion, extracting \texttt{n2}, \texttt{n3}, etc. If we areinterested in the total number of traces, like in the clip example, ashortcut is to use the \texttt{sf\_leftsize} function. Calling\texttt{sf\_leftsize(in,0)} returns the total number of elements inthe hypercube (the product of \texttt{n1}, \texttt{n2}, etc.), calling\texttt{sf\_leftsize(in,1)} returns the number of traces (the productof \texttt{n2}, \texttt{n3}, etc.), calling\texttt{sf\_leftsize(in,2)} returns the product of \texttt{n3},\texttt{n4}, etc. By calling \texttt{sf\_leftsize}, we avoid the needto extract additional parameters for the hypercube dimensions that weare not interested in.\lstinputlisting[firstline=28,lastline=29,frame=single]{\RSF/api/clip.c} The clip parameter is read from the command line, where it can bespecified, for example, as \texttt{clip=10}. The parameter has the\texttt{float} type, therefore we read it with the\texttt{sf\_getfloat} function. If no \texttt{clip=} parameter isfound among the command line arguments, the program is aborted with anerror message using the \texttt{sf\_error} function.\lstinputlisting[firstline=31,lastline=32,frame=single]{\RSF/api/clip.c} Next, we allocate an array of floating-point numbers to store a tracewith the library \texttt{sf\_floatalloc} function. Unlike the standard\texttt{malloc} the RSF allocation function checks for errors andeither terminates the program or returns a valid pointer.\lstinputlisting[firstline=34,lastline=48,frame=single]{\RSF/api/clip.c} The rest of the program is straightforward. We loop over all availabletraces, read each trace, clip it and right the output out. The syntaxof \texttt{sf\_floatread} and \texttt{sf\_floatwrite} functions issimilar to the syntax of the C standard \texttt{fread} and\texttt{fwrite} function except that the type of the element isspecified explicitly in the function name and that the input andoutput files have the RSF type \texttt{sf\_file}.\subsection{Compiling}To compile the \texttt{clip} program, run\begin{verbatim}cc clip.c -I$RSFROOT/include -L$RSFROOT/lib -lrsf -lm\end{verbatim}Change \texttt{cc} to the C compiler appropriate for your system and includeadditional compiler flags if necessary. The flags that RSF typically uses arein \texttt{\$RSFROOT/lib/rsfconfig.py}.\section{C++ interface}\lstset{language=c++}The C++ clip function is listed below.\lstinputlisting[frame=single]{\RSF/api/clip.cc}Let us examine it line by line. \lstinputlisting[firstline=4,lastline=4,frame=single]{\RSF/api/clip.cc}Including ``\texttt{rsf.hh}'' is required for accessing the RSF C++interface.\lstinputlisting[firstline=8,lastline=8,frame=single]{\RSF/api/clip.cc}A call to \texttt{sf\_init} is required to initialize the internally storedtable of command-line arguments.\lstinputlisting[firstline=10,lastline=11,frame=single]{\RSF/api/clip.cc}Two classes: \texttt{iRSF} and \texttt{oRSF} are used to define input andoutput files. For simplicity, the command-line parameters are also handled as an \texttt{iRSF} object, initialized with zero.\lstinputlisting[firstline=16,lastline=17,frame=single]{\RSF/api/clip.cc}Next, we read the data dimensions from the input RSF file object called\texttt{in}: the trace length is a parameter called ``\texttt{n1}'' and thenumber of traces is the size of \texttt{in} remaining after excluding thefirst dimension. It is extracted with the \texttt{size} method.\lstinputlisting[firstline=19,lastline=19,frame=single]{\RSF/api/clip.cc} The clip parameter should be specified on the command line, forexample, as \texttt{clip=10}. It is extracted with the \texttt{get}method of \texttt{iRSF} class from the \texttt{par} object.\lstinputlisting[firstline=21,lastline=21,frame=single]{\RSF/api/clip.cc}The trace object has the single-precision floating-point type and is a1-D array of length \texttt{n1}. It is declared and allocated usingthe \texttt{valarray} template class from the standard C++ library.\lstinputlisting[firstline=23,lastline=32,frame=single]{\RSF/api/clip.cc}Next, we loop through the traces, read each trace from \texttt{in}, clip itand write the output to \texttt{out}.\subsection{Compiling}To compile the C++ program, run\begin{verbatim}c++ clip.cc -I$RSFROOT/include -L$RSFROOT/lib -lrsf++ -lrsf -lm\end{verbatim}Change \texttt{c++} to the C++ compiler appropriate for your system andinclude additional compiler flags if necessary. The flags that RSF typicallyuses are in \texttt{\$RSFROOT/lib/rsfconfig.py}.\section{Fortran-77 interface}\lstset{language=fortran}The Fortran-77 clip function is listed below.\lstinputlisting[frame=single]{\RSF/api/clip.f}Let us examine it in detail.\lstinputlisting[firstline=8,lastline=8,frame=single]{\RSF/api/clip.f}The program starts with a call to \texttt{sf\_init}, which initializes thecommand-line interface.\lstinputlisting[firstline=9,lastline=10,frame=single]{\RSF/api/clip.f}The input and output files are created with calls to\texttt{sf\_input} and \texttt{sf\_output}. Because of the absence ofderived types in Fortran-77, we use simple integer pointers torepresent RSF files. Both \texttt{sf\_input} and \texttt{sf\_output}accept a character string, which may refer to a file name or a filetag. For example, if the command line contains\texttt{vel=velocity.rsf}, then both\texttt{sf\_input("velocity.rsf")} and \texttt{sf\_input("vel")} areacceptable. Two tags are special: \texttt{"in"} refers to the file inthe standard input and \texttt{"out"} refers to the file in thestandard output.\lstinputlisting[firstline=12,lastline=13,frame=single]{\RSF/api/clip.f}RSF files can store data of different types (character, integer,floating point, complex). The function \texttt{sf\_gettype} checks thetype of data stored in the RSF file. We make sure that the typecorresponds to floating-point numbers. If not, the program is aborted

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩综合不卡| 国产精品久线在线观看| 精品国产百合女同互慰| 精品处破学生在线二十三| 久久―日本道色综合久久| 国产精品嫩草影院av蜜臀| 亚洲日穴在线视频| 天天综合网天天综合色| 韩日av一区二区| 色婷婷综合激情| 日韩精品资源二区在线| 亚洲国产电影在线观看| 亚洲成人资源在线| 国产乱子轮精品视频| 一本色道a无线码一区v| 日韩视频中午一区| 国产精品成人一区二区三区夜夜夜 | 欧美一级日韩一级| 国产精品视频看| 爽好久久久欧美精品| 国产一区二区三区最好精华液| eeuss国产一区二区三区| 欧美美女激情18p| 中文字幕精品三区| 图片区小说区区亚洲影院| 国产成人av福利| 欧美日韩国产美| 成人免费小视频| 久草在线在线精品观看| 91久久久免费一区二区| 精品va天堂亚洲国产| 亚洲综合在线视频| 国模一区二区三区白浆| 欧美日韩一区二区三区四区五区| 国产亚洲一区二区三区| 亚洲成人777| 91免费视频网| 国产欧美日本一区视频| 日韩av网站免费在线| 99久久久国产精品| 久久这里都是精品| 日韩极品在线观看| 一本大道久久a久久精品综合| 久久精品欧美日韩| 麻豆成人久久精品二区三区红| 在线影视一区二区三区| 国产精品网站在线播放| 九九热在线视频观看这里只有精品| 欧美无砖砖区免费| 国产精品丝袜一区| 国产一区二区三区四区五区美女 | 国产欧美一区在线| 看电影不卡的网站| 欧美亚洲综合色| 国产精品丝袜91| 国产精品性做久久久久久| 91精品国产综合久久久久久漫画| 综合久久久久久| 黄色日韩网站视频| 欧美一卡在线观看| 日韩av中文字幕一区二区| 日本韩国欧美一区| 亚洲视频免费在线观看| 北岛玲一区二区三区四区| 国产欧美一区二区三区在线看蜜臀| 久久成人麻豆午夜电影| 884aa四虎影成人精品一区| 亚洲国产欧美日韩另类综合| aaa亚洲精品| 国产精品白丝在线| www.在线成人| 自拍视频在线观看一区二区| bt7086福利一区国产| 国产精品福利影院| av电影一区二区| 成人欧美一区二区三区白人| aaa亚洲精品一二三区| 亚洲欧洲日韩综合一区二区| 不卡的av电影在线观看| 亚洲人成网站色在线观看| 色婷婷综合久久久久中文| 亚洲综合999| 制服视频三区第一页精品| 日韩综合在线视频| 日韩精品影音先锋| 国产在线观看免费一区| 国产亚洲一区二区三区| 不卡的av在线| 亚洲另类一区二区| 欧美喷潮久久久xxxxx| 日本最新不卡在线| 欧美成人一区二区三区片免费 | 国产精品无遮挡| 国产成人自拍网| 精品播放一区二区| 免费在线观看不卡| 91精品国产欧美日韩| 亚洲国产日韩a在线播放性色| 91成人在线免费观看| 亚洲精品欧美专区| 在线影视一区二区三区| 亚洲一级电影视频| 欧美久久久久久久久| 偷拍日韩校园综合在线| 欧美精品乱码久久久久久按摩 | 99久久精品费精品国产一区二区| 国产精品久久久久久妇女6080| 国产精品1区2区| 一区二区三区四区在线免费观看 | 欧美国产精品一区二区三区| 国产不卡视频在线播放| 国产精品美女久久久久久久久 | 午夜精品久久久久久久久久久 | 福利一区福利二区| 亚洲日本va在线观看| 99久久精品费精品国产一区二区| 亚洲精品日韩一| 欧美酷刑日本凌虐凌虐| 精品一区二区三区香蕉蜜桃| 精品国产三级a在线观看| 看电视剧不卡顿的网站| 日韩一区欧美小说| 国精产品一区一区三区mba桃花 | 亚洲午夜久久久| 国产亚洲短视频| 26uuu精品一区二区| 日韩美女视频在线| 成人av电影在线播放| av成人免费在线观看| 久久久激情视频| 国产超碰在线一区| 国产日韩综合av| 精品久久久久一区二区国产| 国产一区二区三区日韩| 1024成人网| 欧美日韩一区成人| 国产在线视频精品一区| 最新成人av在线| 91精品婷婷国产综合久久性色| 国产在线国偷精品免费看| 亚洲精品国产一区二区三区四区在线| 欧美高清激情brazzers| 成人综合激情网| 亚洲成人精品一区二区| www成人在线观看| 色偷偷久久人人79超碰人人澡| 日韩精品一区第一页| 国产婷婷色一区二区三区在线| 欧美午夜精品电影| 精品无人区卡一卡二卡三乱码免费卡 | 亚洲另类春色国产| 国产亚洲精久久久久久| 欧美日韩一区二区不卡| 国产白丝精品91爽爽久久| 亚洲成人综合在线| 国产女人18毛片水真多成人如厕 | 亚洲精品亚洲人成人网在线播放| 91精品国产综合久久婷婷香蕉| 粉嫩嫩av羞羞动漫久久久| 成人欧美一区二区三区视频网页| 久久亚洲综合色一区二区三区| 91老师国产黑色丝袜在线| 韩国精品在线观看| 亚洲成人1区2区| 中文字幕一区二区在线播放| 欧美精品自拍偷拍| 成人爱爱电影网址| 麻豆精品在线播放| 亚洲综合色婷婷| 国产精品情趣视频| 欧美精品一区视频| 色妹子一区二区| 99精品视频在线播放观看| 国内精品在线播放| 青青草原综合久久大伊人精品优势| 成人欧美一区二区三区1314| 欧美精品一区视频| 欧美三级电影一区| 成人丝袜高跟foot| 国产一区二区精品久久| 偷拍一区二区三区四区| 亚洲精品伦理在线| 国产精品剧情在线亚洲| 欧美大白屁股肥臀xxxxxx| 91精品国产高清一区二区三区| 欧美午夜一区二区| 91老师国产黑色丝袜在线| 懂色av一区二区三区蜜臀| 激情综合一区二区三区| 亚洲国产一二三| 日精品一区二区| 亚洲成在人线免费| 亚洲国产欧美日韩另类综合| 一区二区三区在线免费视频 | 精品亚洲免费视频| 天天综合天天做天天综合| 中文字幕亚洲区| 国产精品福利一区二区三区| 欧美成人三级在线| 国产欧美一区视频|