• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ cDVector类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: ReAllocValue

void cRegArchValue::ReAllocValue(cDVector& theYt)
{
int mySize = (int)theYt.GetSize() ;
	ClearMatrix(mXt) ;
	if (mySize > 0)
	{	mYt = theYt ;
		mMt.ReAlloc(mySize) ;
		mHt.ReAlloc(mySize) ;
		mUt.ReAlloc(mySize) ;
		mEpst.ReAlloc(mySize) ;
	}
	else
	{	mYt.Delete() ;
		mMt.Delete() ;
		mHt.Delete() ;
		mUt.Delete() ;
		mEpst.Delete() ;
	}
}
开发者ID:rforge,项目名称:rregarch,代码行数:19,代码来源:cRegArchValue.cpp


示例17: VectorToRegArchParam

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


示例18: RegArchParamToVector

void cConstCondVar::RegArchParamToVector(cDVector& theDestVect, uint theIndex) 
{
	if (theDestVect.GetSize() < theIndex - 1)
		throw cRegArchError("wrong size") ;
	theDestVect[theIndex] = mvCste;
}
开发者ID:rforge,项目名称:rregarch,代码行数:6,代码来源:cConstCondVar.cpp


示例19: GetVectSexp

void cRUtil::GetVectSexp(SEXP theSEXP, uint theNum, cDVector& theVal)
{
SEXP myAux = VECTOR_ELT(theSEXP, theNum) ;
	for (register uint i = 0 ; i < theVal.GetSize() ; i++)
		theVal[i] = REAL(myAux)[i] ;
}
开发者ID:rforge,项目名称:rregarch,代码行数:6,代码来源:cRUtils.cpp


示例20: RegArchParamToVector

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cEntity类代码示例发布时间:2022-05-31
下一篇:
C++ cCommandOutputCallback类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap