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


C++ Vector::length方法代码示例

本文整理汇总了C++中yarp::sig::Vector::length方法的典型用法代码示例。如果您正苦于以下问题:C++ Vector::length方法的具体用法?C++ Vector::length怎么用?C++ Vector::length使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yarp::sig::Vector的用法示例。


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

示例1: appendMatrixRow

void iCubShoulderConstr::appendMatrixRow(yarp::sig::Matrix &dest,
                                         const yarp::sig::Vector &row)
{
    yarp::sig::Matrix tmp;

    // if dest is already filled with something
    if (dest.rows())
    {   
        // exit if lengths do not match     
        if (row.length()!=dest.cols())
            return;

        tmp.resize(dest.rows()+1,dest.cols());

        // copy the content of dest in temp
        for (int i=0; i<dest.rows(); i++)
            for (int j=0; j<dest.cols(); j++)
                tmp(i,j)=dest(i,j);

        // reassign dest
        dest=tmp;
    }
    else
        dest.resize(1,row.length());

    // append the last row
    for (int i=0; i<dest.cols(); i++)
        dest(dest.rows()-1,i)=row[i];
}
开发者ID:apostroph,项目名称:icub-main,代码行数:29,代码来源:iKinIpOpt.cpp

示例2: appendVectorValue

void iCubShoulderConstr::appendVectorValue(yarp::sig::Vector &dest, double val)
{
    yarp::sig::Vector tmp(dest.length()+1);
    for (size_t i=0; i<dest.length(); i++)
        tmp[i]=dest[i];

    dest=tmp;
    dest[dest.length()-1]=val;
}
开发者ID:apostroph,项目名称:icub-main,代码行数:9,代码来源:iKinIpOpt.cpp

示例3: PosAxisAngle_To_PosEulerSingle

void YarpJointDev::PosAxisAngle_To_PosEulerSingle ( const yarp::sig::Vector& xd,
        const yarp::sig::Vector& od,
        std::vector< float >& res ) {


    assert ( xd.length() == 3 );
    assert ( od.length() == 4 );

    float wx, wy, wz;

    AxisAngle_To_Euler ( od[0], od[1], od[2], od[3], wx, wy, wz );

    res.clear();

    res.push_back ( xd[0] );
    res.push_back ( xd[1] );
    res.push_back ( xd[2] );

    res.push_back ( wx );
    res.push_back ( wy );
    res.push_back ( wz );


}
开发者ID:jiema,项目名称:NaoYARP,代码行数:24,代码来源:YarpJointDev.cpp


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