Macaulay2 Engine
Loading...
Searching...
No Matches
PointArray.cpp
Go to the documentation of this file.
1// Copyright 2016 Michael E. Stillman
2
29
30#include <cstdio>
31#include <string>
32#include <iostream>
33#include <sstream>
34#include <memory>
35#include <gtest/gtest.h>
36#include <mpfr.h>
37
38#include "NAG.hpp"
39
40TEST(PointArray, constructor)
41{
42 PointArray p(0.001, {0.3, 0.7});
43 PointArray q(0.001, 10);
44}
45
47{
48 PointArray q(0.0001, 4);
49 EXPECT_EQ(q.lookup_or_append({1, 0, .54344, .80331}), 0);
50 EXPECT_EQ(q.lookup_or_append({1, 0, -.25281, 1.032}), 1);
51 PointArray p(0.001, 2);
52 EXPECT_EQ(p.lookup({0.1, -0.1}), -1);
53 EXPECT_EQ(p.lookup_or_append({0.1, -0.1}), 0);
54 EXPECT_EQ(p.lookup_or_append({0.1, -0.1}), 0);
55 EXPECT_EQ(p.lookup_or_append({0.1, -0.2}), 1);
56 EXPECT_EQ(p.lookup({0.1, -0.10001}), 0);
57 EXPECT_EQ(p.lookup_or_append({0.1, -0.10001}), 0);
58}
Numerical Algebraic Geometry: homotopy continuation PathTracker and supporting numeric types.
TEST(PointArray, constructor)
int lookup_or_append(const RealVector &a)
Definition NAG.hpp:134
Container of numerical points equipped with an -tolerance and a random weight vector used to bucket a...
Definition NAG.hpp:112
int p