1 #ifndef VSR_NCUBE_H_INCLUDED
2 #define VSR_NCUBE_H_INCLUDED
4 #include "vsr_products.h"
14 CubeEdge(
int _a,
int _b) : a(_a), b(_b){}
16 void print() { printf(
"%d, %d\n", a, b);}
30 int NumVert = pow(2.f,DIM);
33 vector<CubeEdge> edges;
40 auto next =
NCube<DIM-1>();
42 for (
auto i : next.roots ){
43 roots.push_back( TVec(i+va) );
44 roots.push_back( TVec(i+vb) );
47 int d = pow(2.f, DIM-1);
48 for (
auto i : next.edges ){
50 edges.push_back(
CubeEdge(i.a + d, i.b + d));
53 for (
int i = 0; i < next.NumVert; ++i ){
54 edges.push_back(
CubeEdge(i, i + d) );
58 vector< Vec3 > project(VT dist){
60 for (
auto i : roots ){
61 res.push_back( Proj<DIM>::Call(dist, i) );
66 vector< float > val( VT dist){
69 v.push_back( Proj<DIM>::Val(dist,i) );
81 for (
auto& i : roots){
98 for (
auto i : roots ) { i.bprint(); i.vprint(); }
99 for (
auto i : edges) { i.print(); }
110 typedef EGAMV< 1, typename Blade1<1>::VEC > TVec;
114 vector<CubeEdge> edges;
119 roots.push_back( TVec(-.5) );
120 roots.push_back( TVec(.5) );
125 for (
auto i : roots) { i.bprint(); i.vprint(); }
126 for (
auto i : edges) { i.print(); }
ND Cube.
Definition: vsr_ncube.h:21
Definition: vsr_ncube.h:12
Generic Geometric Number Types (templated on an algebra and a basis )
Definition: vsr_algebra.h:69
static Rot rot(const Biv &b)
vsr::cga::Rotor from vsr::cga::Bivector
core namespaced operations that are metric-agnostic
the versor library namespace
Definition: vsr_algebra.h:29