Coordinate ========== .. cpp:class:: numpy::Coordinate numpy C++ class. Example ------- .. code-block:: cpp #include using namespace numpy; // Use Coordinate Coordinate obj; // ... operations ... Constructors ------------ .. list-table:: :widths: 55 25 20 :header-rows: 1 * - Signature - Location - Example * - ``Coordinate(const std::string& n, const CoordinateValue& v, const std::vector& d =`` - df_xarray.h:73 - Indexing / Selection -------------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``std::string get_value_str(size_t idx) const`` - std::string - df_xarray.h:93 - Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``size_t size() const`` - size_t - df_xarray.h:79 - :ref:`View ` Code Examples ------------- The following examples are extracted from the test suite. .. _example-coordinate-size-0: .. dropdown:: size (np_test_1_all.cpp:47) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 37 :emphasize-lines: 11 using namespace numpy; using namespace numpy::benchmark; using namespace numpy::char_; // Helper functions for array comparison tests namespace { const double TOLERANCE = 1e-10; bool allTrue(const NDArray& arr) { std::vector indices(arr.getShape().size(), 0); do { if (!arr.getElementAt(indices)) { return false; } } while (incrementIndices(indices, arr.getShape())); return true; } bool allFalse(const NDArray& arr) { std::vector indices(arr.getShape().size(), 0);