MagP64

class MagP64

Abstract type representing magnetization type chosen for cavity messages.

Note
The MagP64 type allows fast executions with inexact outcomes by neglecting all tanh operations.

Public Functions

MagP64()

Default constructor.

MagP64(const double &x)

Constructor with value.

Note
In MagP64 the value is equal to the mag.
Parameters
  • x: magnetization

~MagP64()

Default destructor.

MagP64(const MagP64 &m)

Copy constructor.

Parameters

MagP64 &operator=(const MagP64 &m)

Assigment operator constructor.

Parameters

std::string magformat() const

Return the mag description (plain for MagP64).

double value() const

Get the magnetization value.

Note
In MagP64 the value is equal to the mag.

MagP64 operator%(const MagP64 &m)

Overload operator.

Add magnetization ( (m1 + m2) / (1 + m1*m2) ) with clamp.

See
mag :: clamp
Parameters

MagP64 operator+(const MagP64 &m)

Overload operator.

Just a simple addition of the mag values.

Parameters

MagP64 operator/(const double &x)

Overload operator.

Just a simple division as (mag / x)

Parameters
  • x: double value

double operator*(const double &x)

Overload operator.

Just a simple product as (mag * x)

Parameters
  • x: double value

MagP64 operator^(const MagP64 &m)

Overload operator.

Combine two mags as (mag * mag)

Parameters

double operator-(const MagP64 &m)

Overload operator.

Subtract values (val1 - val2)

Note
In MagP64 the values are equal to the mags.
Parameters

MagP64 operator-() const

Get a magnetization with a flipped sign.

flip magnetization sign

bool operator==(const MagP64 &m)

Check magnetization equality.

Compare magnetizations

Parameters

bool operator!=(const MagP64 &m)

Check magnetization not equality.

compare magnetizations

Parameters

Public Members

double mag

Magnetization.

Friends

double operator*(const double &x, const MagP64 &m)

Overload operator.

Just a simple product as (x * mag)

Parameters
  • x: double value
  • m: MagP64 object

std::ostream &operator<<(std::ostream &os, const MagP64 &m)

Print operator with stdout/stderr.

print mag

Parameters
  • os: ostream operator
  • m: MagP64 object