本文整理汇总了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;
}