ComparisonNode#

class numpy::ComparisonNode#

numpy C++ class.

Example#

#include <numpy/np_ndarray.h>
using namespace numpy;

// Use ComparisonNode
ComparisonNode obj;
// ... operations ...

Other Methods#

Signature

Return Type

Location

Example

NodeType type() const override

NodeType

df_query.h:257

View

Code Examples#

The following examples are extracted from the test suite.

type (np_test_1_all.cpp:2240)
2230        std::string description = std::string("testArrayEdgeCases():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(multi_array.getElementAt({0, 1}).is_type<std::string>())";
2231        std::cout << std::string("[FAIL] ") + description << std::endl;
2232        throw std::runtime_error(description);
2233    }
2234    if (!(multi_array.getElementAt({0, 2}).is_type<double>())) {
2235        std::string description = std::string("testArrayEdgeCases():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(multi_array.getElementAt({0, 2}).is_type<double>())";
2236        std::cout << std::string("[FAIL] ") + description << std::endl;
2237        throw std::runtime_error(description);
2238    }
2239
2240    // Test 4: Arrays with all same type (homogeneous)
2241    NDArray<object_> homo_array = createObjectZeros({5});
2242    for (size_t i = 0; i < 5; ++i) {
2243        homo_array.setElementAt({i}, object_(static_cast<int>(i * 10)));
2244    }
2245
2246    // Verify all are same type
2247    for (size_t i = 0; i < 5; ++i) {
2248        object_ obj = homo_array.getElementAt({i});
2249        if (!(obj.is_type<int>())) {
2250            std::string description = std::string("testArrayEdgeCases():") + __FILE__ + ":" + std::to_string(__LINE__) + ": !(obj.is_type<int>())";