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


C++ Cone::getBasisVectors方法代码示例

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


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

示例1: main

int main()
{
    //set up basisvectors
    std::vector<std::vector<double> > basis(2,std::vector<double>(2));
    basis[0][0] = 1;
    basis[0][1] = 0;
    basis[1][0] = 0;
    basis[1][1] = 1;
    
    
    //define lattice
    Lattice myLattice(2,basis);
    
    //set up cones
    
    Cone Sigma0 = Cone({{1,0},{0,1}},myLattice);
    Cone Sigma11 = Cone({{0,1},{-1,0}},myLattice);
    Cone Sigma12 = Cone({{-1,0},{-1,-1}},myLattice);
    Cone Sigma13 = Cone({{-1,-1},{-2,-3}},myLattice);
    Cone Sigma21 = Cone({{-2,-3},{-1,-2}},myLattice);
    Cone Sigma22 = Cone({{-1,-2},{0,-1}},myLattice);
    Cone Sigma23 = Cone({{0,-1},{1,0}},myLattice);
    
    //Define fan
    std::vector<Cone> myCones = {Sigma0, Sigma11, Sigma12, Sigma13, Sigma21, Sigma22, Sigma23};
    Fan myFan(myCones,myLattice);
    
    //Get dual fan
    Fan myDualFan = myFan.getCorrespondingDualFan();
    
    
    std::vector<Cone> myDualCones = myDualFan.getCones();
    std::cout << "CONES OF THE DUAL FAN" << std::endl;
    std::cout << "----------------------" << std::endl;
    for(int i = 0; i < myDualCones.size();++i)
    {
        std::cout << "Cone nr = " << i  << std::endl;
        Cone myDualCone = myDualCones[i];
        std::vector<std::vector<double> > myBVs = myDualCone.getBasisVectors();
        std::cout << "        " << myBVs[0][0] << std::endl;
        std::cout << "Ray 1 = " << myBVs[0][1] << std::endl;
        std::cout << "        " << myBVs[0][2] << std::endl;
        std::cout << "" << std::endl;
        std::cout << "        " << myBVs[1][0] << std::endl;
        std::cout << "Ray 2 = " << myBVs[1][1] << std::endl;
        std::cout << "        " << myBVs[1][2] << std::endl;
        std::cout << "----------------------" << std::endl;
    }
    
    myFan.drawFan();
    myDualFan.drawFan();
  
    return 0;
}
开发者ID:eriklumens,项目名称:PolyTori,代码行数:54,代码来源:mainFromCone.cpp


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