48{
49 double buf_0[] = {1.0, 0.0, 2.0};
50 double buf_1[] = {2.0, 3.0, 0.0};
51
52 std::vector<NekVector<double>> x;
53 x.push_back(NekVector<double>(3, buf_0));
54 x.push_back(NekVector<double>(3, buf_1));
55
57
58 BOOST_CHECK_EQUAL(
q.size(), 2);
59
60 double epsilon = 1e-1;
61 BOOST_CHECK_CLOSE(
q[0][0], .4472, epsilon);
62 BOOST_CHECK_CLOSE(
q[0][1], .0, epsilon);
63 BOOST_CHECK_CLOSE(
q[0][2], .8942, epsilon);
64
65 BOOST_CHECK_CLOSE(
q[1][0], .45811, epsilon);
66 BOOST_CHECK_CLOSE(
q[1][1], .85890, epsilon);
67 BOOST_CHECK_CLOSE(
q[1][2], -.22890, epsilon);
68}
std::vector< double > q(NPUPPER *NPUPPER)
std::vector< NekVector< DataType > > GramSchmidtOrthogonalization(const std::vector< NekVector< DataType > > &x)
Calculates the orthogonal, normalized vectors from linearly independent input.