Class AsyCost

Nested Relationships

Nested Types

Class Documentation

class AsyCost

Represents a symbolic asymptotic cost in terms of active_occupied and the rest orbitals. eg.

  • AsyCost{2,4} implies scaling of $O^2V^4$. In other words, the cost scales by the second power in the number of active_occupied orbitals and the fourth power in the number of the rest orbitals.

  • AsyCost{sequant::rational{1,2}, 2, 4} implies the same scaling as above except the numeric value obtained by substituting $O$ and $V$ numbers is then halved.

Public Functions

AsyCost()

Default construct to zero cost.

AsyCost(rational count, size_t nocc, size_t nvirt)
Parameters:
  • count – Rational number of times this cost repeats.

  • nocc – Asymptotic scaling exponent in the active occupied orbitals.

  • nvirt – Asymptotic scaling exponent in the active unoccupied orbitals.

AsyCost(size_t nocc, size_t nvirt)
Parameters:
  • nocc – Asymptotic scaling exponent in the active occupied orbitals.

  • nvirt – Asymptotic scaling exponent in the active unoccupied orbitals.

explicit AsyCost(std::pair<size_t, size_t> const &ov)
Parameters:

ov – A pair of size_ts. ov.first is the asymptotic scaling exponent in the active occupied orbitals. ov.second is that in the active unoccupied orbitals

AsyCost(AsyCost const&) = default
AsyCost(AsyCost&&) = default
AsyCost &operator=(AsyCost const&) = default
AsyCost &operator=(AsyCost&&) = default
double ops(size_t nocc, size_t nvirt) const
Parameters:
  • nocc – Substitute $O$ by nocc.

  • nvirt – Substitute $V$ by nvirt.

Returns:

Scaled asymptotic cost.

std::wstring to_latex() const
std::string text() const
AsyCost &operator+=(AsyCost const&)
AsyCost &operator-=(AsyCost const&)

Public Static Functions

static AsyCost const &max()
Returns:

The infinitely scaling cost.

static AsyCost const &zero()
Returns:

The zero cost.

Friends

friend AsyCost operator+(AsyCost const &lhs, AsyCost const &rhs)
friend AsyCost operator*(AsyCost const &lhs, rational scale)
friend AsyCost operator*(rational scale, AsyCost const &lhs)
friend bool operator<(AsyCost const &lhs, AsyCost const &rhs)
friend bool operator==(AsyCost const &lhs, AsyCost const &rhs)
friend bool operator<=(AsyCost const &lhs, AsyCost const &rhs)
friend bool operator>=(AsyCost const &lhs, AsyCost const &rhs)