当前位置: 首页>>代码示例>>C++>>正文


C++ cDVector类代码示例

本文整理汇总了C++中cDVector的典型用法代码示例。如果您正苦于以下问题:C++ cDVector类的具体用法?C++ cDVector怎么用?C++ cDVector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了cDVector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetListValSexp

void cRUtil::SetListValSexp(cDVector& theVal, SEXP &theSEXP)
{	mvNbProtect++ ;
	PROTECT(theSEXP = allocVector(VECSXP, theVal.GetSize())) ;
	for (register uint i = 0 ; i < theVal.GetSize() ; i++)
	{	SEXP myAux ;
		SetValSexp(theVal[i], myAux) ;
		SET_VECTOR_ELT(theSEXP, i, myAux) ;
	}
}
开发者ID:rforge,项目名称:rregarch,代码行数:9,代码来源:cRUtils.cpp

示例2: ReAlloc

	/*!
	 * \fn void cConst::ReAlloc(const cDVector& theVectParam, const uint theNumParam)
	 * \param const cDVector& theVectParam: the constant value is in theVectParam[0]
	 * \param const uint theNumParam: not used for cConst class
	 * \details Here, mvConst = theVectParam[0]
	 */
	void cConst::ReAlloc(const cDVector& theVectParam, const uint theNumParam)
	{
		if (theVectParam.GetSize() > 0)
			mvConst = theVectParam[0] ;
		else
			throw cError("Size of 'theVectParam' must be > 0") ;
	}
开发者ID:TeamProgMath,项目名称:ProgMath,代码行数:13,代码来源:cConst.cpp

示例3: RegArchParamToVector

void cAr::RegArchParamToVector(cDVector& theDestVect, uint theIndex)
{
uint mySize = mvAr.GetSize() ;
	if (theDestVect.GetSize() < mySize + theIndex)
		throw cRegArchError("wrong size") ;
	mvAr.SetSubVectorWithThis(theDestVect, theIndex) ;
}
开发者ID:rforge,项目名称:rregarch,代码行数:7,代码来源:cAr.cpp

示例4: VectorToRegArchParam

void cAr::VectorToRegArchParam(const cDVector& theSrcVect, uint theIndex)
{
uint mySize = theSrcVect.GetSize() ;
	if (mvAr.GetSize() + theIndex > mySize)
		throw cRegArchError("wrong size") ;
	mvAr.SetThisWithSubVector(theSrcVect, theIndex) ;
}
开发者ID:rforge,项目名称:rregarch,代码行数:7,代码来源:cAr.cpp

示例5: Transpose

cDMatrix Transpose(const cDVector& theVect)
{
uint myNCol = theVect.GetSize() ;
cDMatrix myTmpMat(1, myNCol) ;
    for (uint i = 0 ; i < myNCol ; i++)
                myTmpMat[0][i] = theVect[i] ;
    return myTmpMat ;
}
开发者ID:cran,项目名称:RHmm,代码行数:8,代码来源:cDMatrix.cpp

示例6: VectorToRegArchParam

		void cArch::VectorToRegArchParam(const cDVector& theSrcVect, uint theIndex)
		{
			uint mySize = theSrcVect.GetSize() ;
			if (GetNParam() + theIndex > mySize)
				throw cError("Wrong size") ;
			mvConst = theSrcVect[theIndex] ;
			mvArch.SetThisWithSubVector(theSrcVect, theIndex+1) ;
		}
开发者ID:TeamProgMath,项目名称:ProgMath,代码行数:8,代码来源:cArch.cpp

示例7: RegArchParamToVector

		void cArch::RegArchParamToVector(cDVector& theDestVect, uint theIndex)
		{
			uint mySize = GetNParam() ;
			if (theDestVect.GetSize() < mySize + theIndex)
				throw cError("Wrong size") ;
			theDestVect[theIndex] = mvConst ;
			mvArch.SetSubVectorWithThis(theDestVect, theIndex+1) ;
		}
开发者ID:TeamProgMath,项目名称:ProgMath,代码行数:8,代码来源:cArch.cpp

示例8: VectorToRegArchParam

void cTarch::VectorToRegArchParam(const cDVector& theSrcVect, uint theIndex)
{
uint mySize = theSrcVect.GetSize() ;
	if (GetNParam() + theIndex > mySize)
		throw cRegArchError("wrong size") ;
	mvCste = theSrcVect[theIndex] ;
	mvArchPos.SetThisWithSubVector(theSrcVect, theIndex+1) ;
	mvArchNeg.SetThisWithSubVector(theSrcVect, theIndex+1+mvArchPos.GetSize()) ;
}
开发者ID:rforge,项目名称:rregarch,代码行数:9,代码来源:cTarch.cpp

示例9: Diag

cDMatrix Diag(cDVector& theVect)
{
uint mySize = theVect.GetSize() ;
cDMatrix myTempMatrix(mySize, mySize) ;
        for (register uint i = 0 ; i <mySize ; i++)
                myTempMatrix[i][i] = theVect[i] ;

        return myTempMatrix ;
}
开发者ID:cran,项目名称:RHmm,代码行数:9,代码来源:cDMatrix.cpp

示例10: RegArchParamToVector

void cTarch::RegArchParamToVector(cDVector& theDestVect, uint theIndex)
{
uint mySize = GetNParam() ;
	if (theDestVect.GetSize() < mySize + theIndex)
		throw cRegArchError("wrong size") ;
	theDestVect[theIndex] = mvCste ;
	mvArchPos.SetSubVectorWithThis(theDestVect, theIndex+1) ;
	mvArchNeg.SetSubVectorWithThis(theDestVect, theIndex+1+mvArchPos.GetSize()) ;

}
开发者ID:rforge,项目名称:rregarch,代码行数:10,代码来源:cTarch.cpp

示例11: MatMult

static cDMatrix MatMult(const cDVector& theVect, const cDMatrix& theMat)
{
uint myNRow = theVect.GetSize() ;
uint myNCol = theMat.GetNCols() ;
cDMatrix myTmpMat(myNRow, myNCol) ;
    
    for (uint i = 0 ; i < myNCol ; i++)
    {   for (uint j = 0 ; j < myNRow ; j++)
            myTmpMat[i][j] = theVect[i] * theMat[0][j] ;
    }
    return myTmpMat ;
}
开发者ID:cran,项目名称:RHmm,代码行数:12,代码来源:cDMatrix.cpp

示例12: VectorToRegArchParam

void cAparch::VectorToRegArchParam(const cDVector& theSrcVect, uint theIndex)
{uint	mySize = theSrcVect.GetSize(),
		myIndex = theIndex ;
	if (GetNParam() + theIndex > mySize)
		throw cRegArchError("wrong size") ;
	mvCste = theSrcVect[myIndex++] ;
	mvDelta = theSrcVect[myIndex++] ;
	mvArch.SetThisWithSubVector(theSrcVect,myIndex) ;
	myIndex += mvArch.GetSize() ;
	mvGamma.SetThisWithSubVector(theSrcVect,myIndex) ;
	myIndex += mvGamma.GetSize() ;
	mvGarch.SetThisWithSubVector(theSrcVect,myIndex) ;
}
开发者ID:rforge,项目名称:rregarch,代码行数:13,代码来源:cAparch.cpp

示例13: AddColRow

void AddColRow(const cDVector& theColRow, cDMatrix& theMat) 
{
uint myNRow = theMat.GetNRows() ;
uint myNCol = theMat.GetNCols() ;
uint mySize = theColRow.GetSize() ;
	if ( (myNRow != myNCol) || (myNRow + 1 != mySize) )
		throw cOTError("Wrong sizes in AddColRow") ;
cDMatrix mySrcMatrix = theMat ;
	theMat.ReAlloc(mySize, mySize) ;
	SetSubMatrix(mySrcMatrix, 0, 0, theMat) ;
	for (register uint i = 0 ; i < mySize  ; i++)
		theMat[i][mySize-1] = theMat[mySize-1][i] = theColRow[i] ;
}
开发者ID:cran,项目名称:RHmm,代码行数:13,代码来源:cDMatrix.cpp

示例14: RegArchParamToVector

void cAparch::RegArchParamToVector(cDVector& theDestVect, uint theIndex)
{
uint	mySize = GetNParam(),
		myIndex = theIndex		;
	
	if (theDestVect.GetSize() < mySize + theIndex)
		throw cRegArchError("wrong size") ;
	theDestVect[myIndex++] = mvCste ;
	theDestVect[myIndex++] = mvDelta ;
	mvArch.SetSubVectorWithThis(theDestVect, myIndex) ;
	myIndex += mvArch.GetSize() ;
	mvGamma.SetSubVectorWithThis(theDestVect, myIndex) ;
	myIndex += mvGamma.GetSize() ;
	mvGarch.SetSubVectorWithThis(theDestVect, myIndex) ;
}
开发者ID:rforge,项目名称:rregarch,代码行数:15,代码来源:cAparch.cpp

示例15: Set

		/*!
		 * \fn void cArch::Set(const cDVector& theVectParam, const uint theNumParam)
		 * \brief fill the parameters vector
		 * \param const cDVector& theVectParam: the vector of values
		 * \param const uint theNumParam: =0, mvConst; =1, mvArch
		 * \details mvArch = theVectParam or mvConst = theVectParam[0]
		 */
		void cArch::Set(const cDVector& theVectParam, const uint theNumParam)
		{	switch (theNumParam)
			{	case 0 :
				if (theVectParam.GetSize() > 0)
					mvConst = theVectParam[0] ;
				else
					throw cError("cArch::Set - Size of theVectParam must be > 0") ;
				break ;
				case 1 :
				mvArch = theVectParam ;
				break ;
				default:
				throw cError("cArch::Set - theNumParam must be in 0, 1") ;
				break ;
			}
		}
开发者ID:TeamProgMath,项目名称:ProgMath,代码行数:23,代码来源:cArch.cpp


注:本文中的cDVector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。