Constant#

class swordfish._swordfishcpp.Constant#

The base class for all Swordfish objects.

All data types (such as Int, String) and data forms (such as Vector, Table) inherit from this class.

Provides common operations and properties for all Swordfish data objects.

property form: DataForm#

Retrieves the data form (DataForm) of a Constant object.

Returns:

The data form representing the structure of the data (e.g. SCALAR, VECTOR, TABLE).

Return type:

DataForm

property type: DataType#

Retrieves the data type (DataType) of a Constant object.

Returns:

The data type representing the type of the data (e.g., INT, FLOAT, STRING).

Return type:

DataType

is_null()#

Checks if the object is a NULL value or contains NULL elements.

Returns:

A boolean Constant indicating whether elements are NULL. For scalar input, returns a single boolean value. For non-scalar input, returns a result with the same shape as the input.

Return type:

Constant

rows()#

Returns the number of rows in the object.

Returns:

The number of rows. For scalar objects, returns 1.

Return type:

Int

cols()#

Returns the number of columns in the object.

Returns:

The number of columns. For scalar objects, returns 1.

Return type:

Int