matrix

Defined in header: <ixion/matrix.hpp>

class matrix

2-dimensional matrix consisting of elements of variable types. Each element can be numeric, string, or empty. This class is used to represent range values or in-line matrices.

Public Types

enum class element_type

Values:

enumerator numeric
enumerator string
enumerator boolean
enumerator error
enumerator empty

Public Functions

matrix()
matrix(size_t rows, size_t cols)
matrix(size_t rows, size_t cols, double numeric)
matrix(size_t rows, size_t cols, bool boolean)
matrix(size_t rows, size_t cols, std::string str)
matrix(size_t rows, size_t cols, formula_error_t error)
matrix(const matrix &other)
matrix(matrix &&other)
matrix(const numeric_matrix &other)
~matrix()
matrix &operator=(matrix other)
bool is_numeric() const

Determine if the entire matrix consists only of numeric value elements.

Returns:

true if the entire matrix consits only of numeric value elements, false otherwise.

bool get_boolean(size_t row, size_t col) const
bool is_numeric(size_t row, size_t col) const
double get_numeric(size_t row, size_t col) const
void set(size_t row, size_t col, double val)
void set(size_t row, size_t col, bool val)
void set(size_t row, size_t col, std::string str)
void set(size_t row, size_t col, formula_error_t val)
element get(size_t row, size_t col) const
size_t row_size() const
size_t col_size() const
void swap(matrix &r)
numeric_matrix as_numeric() const
bool operator==(const matrix &r) const
struct element

Public Types

using value_type = std::variant<double, bool, std::string_view, formula_error_t>

Public Members

element_type type
value_type value