Skip to content

Instantly share code, notes, and snippets.

@stephanmg
stephanmg / tetrahedralize.cpp
Last active March 30, 2016 16:49
Tetrahedralize
bool test_tetgen() {
/// grid management
Grid g;
ug::SubsetHandler sh(g);
g.attach_to_vertices(ug::aPosition);
ug::Grid::VertexAttachmentAccessor<ug::APosition3> aaPos(g, ug::aPosition);
/// unit cube
ug::RegularVertex* temp1 = *g.create<ug::RegularVertex>();
ug::RegularVertex* temp2 = *g.create<ug::RegularVertex>();
@stephanmg
stephanmg / gram_schmidt.cpp
Last active March 24, 2016 05:18
Gram-Schmidt for n x m matrix, n >= m
#include <cstdlib>
#include <iostream>
#include <math.h>
using namespace std;
/// matrix dimensions n >= m for my use case
const int n = 3;
const int m = 2;