⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qccvector.3

📁 spiht for linux this is used to decod and encode vedio i wich all enjoy
💻 3
字号:
.TH QCCVECTOR 3 "QCCPACK" "".SH NAMEQccVectorAlloc,QccVectorFree,QccVectorZero,QccVectorResize,QccVectorMean,QccVectorVariance,QccVectorAdd,QccVectorSubtract,QccVectorScalarMult,QccVectorCopy,QccVectorNorm,QccVectorNormalize,QccVectorDotProduct,QccVectorAngle,QccVectorSquareDistance,QccVectorSumComponents,QccVectorMaxValue,QccVectorMinValue,QccVectorPrint\- miscellaneous vector routines.SH SYNOPSIS.B #include "libQccPack.h".sp.BI "QccVector QccVectorAlloc(int " vector_dimension );.br.sp.BI "void QccVectorFree(QccVector " vector );.br.sp.BI "int QccVectorZero(QccVector " vector ", int " vector_dimension );.br.sp.BI "QccVector QccVectorResize(QccVector " vector ", int " vector_dimension ", int " new_vector_dimension );.br.sp.BI "double QccVectorMean(const QccVector " vector ", int " vector_dimension );.br.sp.BI "double QccVectorVariance(const QccVector " vector ", int " vector_dimension );.br.sp.BI "int QccVectorAdd(QccVector " vector1 ", const QccVector " vector2 ", int " vector_dimension );.br.sp.BI "int QccVectorSubtract(QccVector " vector1 ", const QccVector " vector2 ", int " vector_dimension );.br.sp.BI "int QccVectorScalarMult(QccVector " vector ", double " s ", int " vector_dimension );.br.sp.BI "int QccVectorCopy(QccVector " vector1 ", const QccVector " vector2 ", int " vector_dimension );.br.sp.BI "double QccVectorNorm(const QccVector " vector ", int " vector_dimension );.br.sp.BI "double QccVectorNormalize(QccVector " vector ", int " vector_dimension );.br.sp.BI "double QccVectorDotProduct(const QccVector " vector1 ", const QccVector " vector2 ", int "vector_dimension );.br.sp.BI "double QccVectorAngle(const QccVector " vector1 ", const QccVector " vector2 ", int " vector_dimension ", int " degrees );.br.sp.BI "double QccVectorSquareDistance(const QccVector " vector1 ", const QccVector " vector2 ", int " vector_dimension );.br.sp.BI "double QccVectorSumComponents(const QccVector " vector ", int " vector_dimension );.br.sp.BI "double QccVectorMaxValue(const QccVector " vector ", int " vector_dimension ", int *" winner );.br.sp.BI "double QccVectorMinValue(const QccVector " vector ", int " vector_dimension ", int *" winner );.br.sp.BI "int QccVectorPrint(const QccVector " vector ", int " vector_dimension );.SH DESCRIPTIONThe QccPack library routines use a one-dimensionalvector type defined as follows:.RS.nftypedef double *QccVector;.fi.RE.LP.B QccVectorAlloc()allocates space for a .B QccVectorof dimension.IR vector_dimension ..B QccVectorAlloc()returns a.B NULLpointer if the allocation fails..LP.B QccVectorFree()frees the space previously allocated via.B QccVectorAlloc().LP.B QccVectorZero()makes each component of.IR vectorzero..B QccVectorZero()returns 0 on success, 1 on failure..LP.B QccVectorResize()changes the dimension of.I vectorfrom.I vector_dimension to.I new_vector_dimension by calling.BR realloc (3).Upon success, the new vector is returned; a.B NULLpointer is returned if .BR realloc (3)fails. If.I vectoris.BR NULL ,.BR QccVectorAlloc()is called. In any case, all elements added to.I vectorare zero..LP.B QccVectorMean()returns the mean value of all the componentsof.IR vector .In the case that.I vectoris.BR NULL ,.B QccVectorMean()returns 0.0..LP.B QccVectorVariance()returns the variance of the componentsof.IR vector .In the case that.I vectoris.BR NULL ,.B QccVectorVariance()returns 0.0..LP.B QccVectorSum()returns the sum of all the components of.IR vector .In the case that.I vectoris.BR NULL ,.B QccVectorSum()returns 0.0..LP.B QccVectorAdd()adds each component of.I vector1to the corresponding component of.I vector2(vector addition).The resulting vector is returned in.IR vector1 .Both.I vector1and.I vector2must have the same vector dimension,.IR vector_dimension ..B QccVectorAdd()returns 0 on success, 1 on failure..LP.B QccVectorSubtract()subtracts each component of .I vector2from the corresponding component of.IR vector1 .The resulting vector is returned in.IR vector1 .Both.I vector1and.I vector2must have the same vector dimension,.IR vector_dimension ..B QccVectorSubtract()returns 0 on success, 1 on failure..LP.B QccVectorScalarMult()multiplies vector.I vectorby the scalar.IR s ;that is, each component of.I vector is multiplied by the.B double.IR s ,and the resulting vector is returned in.IR vector ..B QccVectorScalarMult()returns 0 on success,1 on failure..LP.B QccVectorCopy()copies.I vector2to.IR vector1 ..B QccVectorCopy()returns 0 on success,1 on failure..LP.B QccVectorNorm()calculates the norm (square root of dot product) of.IR vector .If .I vectoris.BR NULL ,0.0 is returned..LP.B QccVectorNormalize()divides .I vectorby its nonzero norm as calculated by.BR QccVectorNorm() .The resulting vector, which has unit length, is returned in.IR vector .If, on the other hand, the vector norm is originally zero, .I vectoris not changed..LP.B QccVectorDotProduct()calculates and returns the dot product of vectors.I vector1and.IR vector2 .Both.I vector1and.I vector2must have the same vector dimension,.IR vector_dimension .If either.I vector1or.I vector2is.BR NULL ,0.0 is returned..LP.B QccVectorAngle()calculates and returns the angle between vectors.I vector1and.IR vector2 .Both.I vector1and.I vector2must have the same vector dimension,.IR vector_dimension .If either.I vector1or.I vector2is.BR NULL ,0.0 is returned.If.IR degreesis nonzero, the angle is return is degrees; otherwise, it isreturned in radians..B QccVectorAngle()calls.BR QccVectorDotProduct() and.BR QccVectorNorm() ;the angle is the.BR acos (3)of the dot product divided by the two vector norms.If either vector has zero norm, 0.0 is returned..LP.B QccVectorSquareDistance()calculates the squared Euclidean distance between vectors.I vector1and.IR vector2 .That is, .I vector2is subtracted from.I vector1and the dot product of the difference vector is returned.Both.I vector1and.I vector2must have the same vector dimension,.IR vector_dimension .If either.I vector1or.I vector2is.BR NULL ,0.0 is returned..LP.B QccVectorSumComponents()adds all the components of .I vectortogether and returns the sum..LP.B QccVectorMaxValue()returns the value of the largest component of.IR vector .If.I winneris not a .B NULLpointer, the index (0 through.I vector_dimension- 1) of the maximum component is returned in the.B intpointed to by .IR winner ..LP.B QccVectorMinValue()returns the value of the smallest component of.IR vector .If.I winneris not a .B NULLpointer, the index (0 through.I vector_dimension- 1) of the minimum component is returned in the.B intpointed to by .IR winner ..LP.B QccVectorPrint()prints the components of.I vectorto stdout..SH "SEE ALSO".BR QccPack (3).SH NOTESExcept as noted above,these vector routines accept .B NULLvector pointers,in which casethese routines return immediately without generating an error or performingany operations..SH AUTHORCopyright (C) 1997-2009  James E. Fowler.\"  The programs herein are free software; you can redistribute them an.or.\"  modify them under the terms of the GNU General Public License.\"  as published by the Free Software Foundation; either version 2.\"  of the License, or (at your option) any later version..\"  .\"  These programs are distributed in the hope that they will be useful,.\"  but WITHOUT ANY WARRANTY; without even the implied warranty of.\"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the.\"  GNU General Public License for more details..\"  .\"  You should have received a copy of the GNU General Public License.\"  along with these programs; if not, write to the Free Software.\"  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -