APyCFixedArray

class APyCFixedArray : public APyArray<apy_limb_t, APyCFixedArray>

Public Functions

inline APyCFixed create_scalar() const
inline APyCFixedArray create_array(const std::vector<std::size_t> &shape) const
inline bool same_type_as(const APyCFixedArray &other) const noexcept

Test if two fixed-point vectors have the same bit specifiers.

inline bool same_type_as(const APyCFixed &other) const noexcept

Test if *this has the same bit specifiers as another APyCFixed

APyCFixedArray() = delete

No default (empty) constructed APyCFixedArray objects. At lesast the bit-specifiers and shape has to be set during construction.

explicit APyCFixedArray(const nb::sequence &bit_pattern_sequence, std::optional<int> int_bits = std::nullopt, std::optional<int> frac_bits = std::nullopt, std::optional<int> bits = std::nullopt)
explicit APyCFixedArray(const std::vector<std::size_t> &shape, int bits, int int_bits)

Constructor: specify only shape and word-length. Zero data on construction.

explicit APyCFixedArray(const std::vector<std::size_t> &shape, int bits, int int_bits, vector_type &&v)

Constructor: specify shape and word-length and steal the data from vector.

explicit APyCFixedArray(const std::vector<std::size_t> &shape, std::optional<int> int_bits = std::nullopt, std::optional<int> frac_bits = std::nullopt, std::optional<int> bits = std::nullopt)

Constructor: specify only shape and word-length. Zero data on construction.

inline APyCFixedArray python_copy() const

Copy array.

inline APyCFixedArray python_deepcopy(const nb::dict &memo) const

Deepcopy array (same as copy here)

APyCFixedArray operator+(const APyCFixedArray &rhs) const
APyCFixedArray operator+(const APyCFixed &rhs) const
APyCFixedArray operator-(const APyCFixedArray &rhs) const
APyCFixedArray operator-(const APyCFixed &rhs) const
APyCFixedArray operator*(const APyCFixedArray &rhs) const
APyCFixedArray operator*(const APyCFixed &rhs) const
APyCFixedArray operator/(const APyCFixedArray &rhs) const
APyCFixedArray operator/(const APyCFixed &rhs) const
APyCFixedArray operator<<(const int shift_val) const
APyCFixedArray operator>>(const int shift_val) const
APyCFixedArray &operator<<=(const int shift_val)
APyCFixedArray &operator>>=(const int shift_val)
APyCFixedArray rsub(const APyCFixed &rhs) const
APyCFixedArray rdiv(const APyCFixed &rhs) const
APyCFixedArray operator-() const

Elementwise unary negation.

inline APyCFixedArray operator+() const

Elementwise unary positive.

APyCFixedArray operator~() const

Elementwise logic not.

inline int bits() const noexcept

Number of bits.

inline int int_bits() const noexcept

Number of integer bits.

inline int frac_bits() const noexcept

Number of fractional bits.

std::string repr() const

Retrieve the string representation.

nb::ndarray<nb::numpy, std::complex<double>> to_numpy() const

Convert to a NumPy array.

std::variant<APyCFixedArray, APyCFixed> sum(std::optional<std::variant<nb::tuple, nb::int_>> axis = std::nullopt) const

Sum over one or more axes.

APyCFixedArray cumsum(std::optional<nb::int_> axis = std::nullopt) const

Cumulative sum over one or more axes.

std::variant<APyCFixedArray, APyCFixed> prod(std::optional<std::variant<nb::tuple, nb::int_>> axis = std::nullopt) const

Multiplication over one or more axes.

APyCFixedArray cumprod(std::optional<nb::int_> axis = std::nullopt) const

Cumulative multiplication over one or more axes.

APyFixedArray get_real() const

Retrieve real part.

APyFixedArray get_imag() const

Retrieve imaginary part.

APyCFixedArray cast(std::optional<int> int_bits = std::nullopt, std::optional<int> frac_bits = std::nullopt, std::optional<QuantizationMode> quantization = std::nullopt, std::optional<OverflowMode> overflow = std::nullopt, std::optional<int> bits = std::nullopt) const

Construct a new APyCFixedArray tensor object with the same shape and fixed-point values as *this, but with a new word-length. The underlying bit-pattern of each tensor element are copied into place, meaning that lowering the number of fractional bits may result in quantization, and lowering the number of integer bits may result in overflowing. Supports quantization and overflow options on narrowing casts.

Public Static Functions

static inline APyCFixedArray create_array_static(const std::vector<std::size_t> &shape, const APyCFixed &fix)
static APyCFixedArray from_complex(const nb::sequence &double_seq, std::optional<int> int_bits = std::nullopt, std::optional<int> frac_bits = std::nullopt, std::optional<int> bits = std::nullopt)

Create an APyCFixedArray tensor object initialized with values from a sequence of complex

static APyCFixedArray from_numbers(const nb::sequence &number_seq, std::optional<int> int_bits = std::nullopt, std::optional<int> frac_bits = std::nullopt, std::optional<int> bits = std::nullopt)

Create an APyCFixedArray tensor object initialized with values from a sequence of numbers

static APyCFixedArray from_array(const nb::ndarray<nb::c_contig> &double_seq, std::optional<int> int_bits = std::nullopt, std::optional<int> frac_bits = std::nullopt, std::optional<int> bits = std::nullopt)

Create an APyCFixedArray tensor object initialized with values from an ndarray.

static APyCFixedArray zeros(const nb::tuple &shape, std::optional<int> int_bits = std::nullopt, std::optional<int> frac_bits = std::nullopt, std::optional<int> bits = std::nullopt)

Create an APyCFixedArray initialized with zeros.

static APyCFixedArray ones(const nb::tuple &shape, std::optional<int> int_bits = std::nullopt, std::optional<int> frac_bits = std::nullopt, std::optional<int> bits = std::nullopt)

Create an APyCFixedArray initialized with ones.

static APyCFixedArray eye(const nb::int_ &N, std::optional<nb::int_> M = std::nullopt, std::optional<int> int_bits = std::nullopt, std::optional<int> frac_bits = std::nullopt, std::optional<int> bits = std::nullopt)

Create an APyCFixedArray with ones on the diagonal and zeros elsewhere.

static APyCFixedArray identity(const nb::int_ &N, std::optional<int> int_bits = std::nullopt, std::optional<int> frac_bits = std::nullopt, std::optional<int> bits = std::nullopt)

Create a square APyCFixedArray with ones on the diagonal and zeros elsewhere.

static APyCFixedArray arange(const nb::object &start, const nb::object &stop, const nb::object &step, std::optional<int> int_bits = std::nullopt, std::optional<int> frac_bits = std::nullopt, std::optional<int> bits = std::nullopt)

Create an APyCFixedArray with evenly spaced values within a given interval.

Public Static Attributes

static constexpr auto ARRAY_NAME = std::string_view("APyCFixedArray")

Name of this array type (used when throwing errors)