inc

Symbolic

class sme::common::Symbolic

Public Functions

Symbolic()
explicit Symbolic(const std::vector<std::string> &expressions, const std::vector<std::string> &variables = {}, const std::vector<std::pair<std::string, double>> &constants = {}, const std::vector<SymbolicFunction> &functions = {})
inline explicit Symbolic(const std::string &expression, const std::vector<std::string> &variables = {}, const std::vector<std::pair<std::string, double>> &constants = {}, const std::vector<SymbolicFunction> &functions = {})
Symbolic(Symbolic&&) noexcept
Symbolic(const Symbolic&) = delete
Symbolic &operator=(Symbolic&&) noexcept
Symbolic &operator=(const Symbolic&) = delete
~Symbolic()
void compile(bool doCSE = true, unsigned optLevel = 3)
std::string expr(std::size_t i = 0) const
std::string inlinedExpr(std::size_t i = 0) const
std::string diff(const std::string &var, std::size_t i = 0) const
void relabel(const std::vector<std::string> &newVariables)
void rescale(double factor, const std::vector<std::string> &exclusions = {})
void eval(std::vector<double> &results, const std::vector<double> &vars = {}) const
void eval(double *results, const double *vars) const
bool isValid() const
bool isCompiled() const
const std::string &getErrorMessage() const

Public Static Functions

static const char *getLLVMVersion()
struct SymEngineFunc

Public Functions

SymEngineFunc() = default
explicit SymEngineFunc(const SymbolicFunction &symbolicFunction)

Public Members

std::string name = {}
vec_basic args = {}
RCP<const Basic> body = {}
struct SymEngineWrapper

Public Members

LLVMDoubleVisitor lambdaLLVM = {}
vec_basic exprInlined = {}
vec_basic exprOriginal = {}
vec_basic varVec = {}
std::map<std::string, RCP<const Symbol>, std::less<>> symbols = {}
std::string errorMessage = {}

TiffReader

class sme::common::TiffReader

Public Functions

explicit TiffReader(const std::string &filename)
std::size_t size() const
QImage getImage(std::size_t i = 0) const
const QString &getErrorMessage() const

serialization.hpp

namespace sme
namespace common
struct SmeFileContents

Public Members

std::string xmlModel = {}
std::unique_ptr<simulate::SimulationData> simulationData = {}

utils.hpp

namespace sme
namespace common

Functions

template<typename Container>
Container::value_type sum(const Container &c)

The sum of all elements in a container.

template<typename Container>
Container::value_type average(const Container &c)

The average of all elements in a container.

template<typename Container>
Container::value_type min(const Container &c)

The minimum value in a container.

template<typename Container>
Container::value_type max(const Container &c)

The maximum value in a container.

template<typename Container>
std::pair<typename Container::value_type, typename Container::value_type> minmax(const Container &c)

The minimum and maximum values in a container.

template<typename Container>
std::size_t min_element_index(const Container &c)

The index in the container of the minimum element.

template<typename Container, typename Element>
std::size_t element_index(const Container &c, const Element &e, std::size_t index_if_not_found = 0)

The index in the container of the matching element.

template<typename T>
constexpr auto decltypeStr()

The type of an object as a string.

template<typename T>
std::vector<T> stringToVector(const std::string &str)

Convert a string to a vector of values.

The values in the string are separated by spaces.

Template Parameters

T – the type of the values

template<typename T>
std::string vectorToString(const std::vector<T> &vec)

Convert a vector of values to a string.

The values in the string are separated by spaces. Doubles are printed in scientific notation with 17 significant digits.

Template Parameters

T – the type of the values

template<typename T>
std::vector<std::size_t> getIndicesOfSortedVector(const std::vector<T> &unsorted)

Indices of elements if vector were sorted.

Returns a vector of indices, such that the vector would be sorted if the elements were in this order.

Template Parameters

T – the type of the values in the vector

template<typename T>
void cyclicErase(std::vector<T> &v, std::size_t first, std::size_t last)

Cyclic erase of elements from a vector.

Erase the elements with index [first, last) from the vector v, with cyclic indices, i.e. the next element after the last element is the first element of the vector

Template Parameters

T – the value type

template<typename T>
bool isCyclicPermutation(const std::vector<T> &a, const std::vector<T> &b)

Check if a vector is a cyclic permutation of another vector.

Note

Assumes the elements of the vector are unique

Template Parameters

T – the value type

class indexedColours
#include <utils.hpp>

Default set of colours.

A vector of default colours

Public Functions

const QColor &operator[](std::size_t i) const

Private Static Attributes

static const std::vector<QColor> colours = std::vector<QColor>{{230, 25, 75}, {60, 180, 75}, {255, 225, 25}, {0, 130, 200}, {245, 130, 48}, {145, 30, 180}, {70, 240, 240}, {240, 50, 230}, {210, 245, 60}, {250, 190, 190}, {0, 128, 128}, {230, 190, 255}, {170, 110, 40}, {255, 250, 200}, {128, 0, 0}, {170, 255, 195}, {128, 128, 0}, {255, 215, 180}, {0, 0, 128}, {128, 128, 128}}
class QPointFlattener
#include <utils.hpp>

Convert a (2d) QPoint to an integer.

Given a bounding box and a QPoint within this box, return an integer that identifies this point.

Public Functions

explicit QPointFlattener(const QSize &boundingBox)
bool isValid(const QPoint &point) const

Check if the point is inside the bounding box.

std::size_t flatten(const QPoint &point) const

Return an index corresponding to the given point.

Private Members

QSize box
class QPointIndexer
#include <utils.hpp>

Fast look-up of points within a bounding box.

Stores a set of points that lie within a bounding box. Allows fast look-up of the index of each point.

Public Functions

explicit QPointIndexer(const QSize &boundingBox, const std::vector<QPoint> &qPoints = {})
void addPoints(const std::vector<QPoint> &qPoints)
std::optional<std::size_t> getIndex(const QPoint &point) const
std::size_t getNumPoints() const

Private Members

QPointFlattener flattener
std::size_t nPoints = 0
std::vector<std::size_t> pointIndex
class QPointUniqueIndexer
#include <utils.hpp>

Fast look-up of unique points within a bounding box.

Stores a set of unique points that lie within a bounding box. Allows fast look-up of the index of each point.

See also

QPointIndexer

Public Functions

explicit QPointUniqueIndexer(const QSize &boundingBox, const std::vector<QPoint> &qPoints = {})
void addPoints(const std::vector<QPoint> &qPoints)
std::optional<std::size_t> getIndex(const QPoint &point) const
std::vector<QPoint> getPoints() const

Private Members

QPointFlattener flattener
std::size_t nPoints = 0
std::vector<std::size_t> pointIndex
std::vector<QPoint> points