| IGLib 1.4 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files
- Directories

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Public Attributes | Properties

# IG::Num::Scalar Struct Reference

Represents a real number. More...

Collaboration diagram for IG::Num::Scalar:
[legend]

List of all members.

## Public Member Functions
| Scalar (Scalar v)
| Scalar (double v)
void | Copy (Scalar s)
| Copies a scalar to the current scalar.
void | Copy (double d)
| Copies double to the current scalar.
int | Compare (Scalar a, Scalar b)
override bool | Equals (object obj)
| Indicates whether `obj` is equal to this instance.
bool | Equals (Scalar a)
| Indicates whether `a` is equal to this instance.
override int | GetHashCode ()
| Gets the hashcode of this `Scalar`.
int | CompareTo (Scalar other)
| Compare this Scalar with another Scalar.
override string | ToString ()
| Returns standard string representation of a scalar, with decimal point and e for exponent, no 1000 separators, number of digits according to type accuracy.
string | ToString (string format, IFormatProvider formatProvider)
| Returns a string representation of a scalar in the specified way.
int | read (string str)
| Reads in the value from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.
int | Read (string str, int startpos)
| Reads in the value from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.
int | Read (string str, int startpos, bool skipspaces)
| Reads in the value from a string, starting at a specified position. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.
void | Copy (string str)
| Parses a scalar from a string and sets the value to the parsed scalar. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a scalar.
bool | TryCopy (string str)
| Parses a scalar from a string and sets the value to the parsed scalar. Leading and trailing spaces are ignored, but other characters are not. false is returned if parsing was not successful, but no exception is thrown in this case.
## Static Public Member Functions
static void | Copy (Scalar a, ref Scalar res)
| Copies a scalar to another (existing) scalar in place.
static void | Copy (double a, ref Scalar res)
| Copies a number to an (existing) scalar in place.
static Scalar | NaN ()
| Creates a scalar that is not a number.
static Scalar | PositiveInfinity ()
| Creates a scalar that represents positive infinity.
static Scalar | NegativeInfinity ()
| Creates a scalar that represents negative infinity.
static Scalar | MinValue ()
| Creates a scalar that contains minimal representable value.
static Scalar | MaxValue ()
| Creates a scalar that contains maximal representable value.
static Scalar | Epsilon ()
| Creates a scalar that contains the smallest positive value greater than 0.
static Scalar | operator+ (Scalar s)
static Scalar | operator- (Scalar s)
static Scalar | operator+ (Scalar a, Scalar b)
static Scalar | operator- (Scalar a, Scalar b)
static Scalar | operator* (Scalar a, Scalar b)
static Scalar | operator/ (Scalar a, Scalar b)
static bool | operator== (Scalar a, Scalar b)
static bool | operator!= (Scalar a, Scalar b)
static bool | operator< (Scalar a, Scalar b)
static bool | operator> (Scalar a, Scalar b)
static bool | operator<= (Scalar a, Scalar b)
static bool | operator>= (Scalar a, Scalar b)
static implicit | operator double (Scalar a)
| Implicit conversion from Scalar to double.
static implicit | operator Scalar (double a)
| Implicit conversion from double to Scalar.
static int | Read (ref Scalar result, string str)
| Reads a scalar from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.
static int | Read (ref Scalar result, string str, int startpos)
| Reads a scalar from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.
static int | Read (ref Scalar result, string str, int startpos, bool skipspaces)
| Reads a scalar from a string, starting at a specified position. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.
static Scalar | Parse (string str)
| Parses a scalar from a string and returns it. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a scalar.
static bool | TryParse (string str, ref Scalar result)
| Parses a scalar from a string and returns it. Leading and trailing spaces are ignored, but other characters are not. false is returned if parsing was not successful, but no exception is thrown in this case.
static void | Examples ()
| Examples of using the Scalar class.
## Public Attributes
double | Value
| Value of the scalar.
## Properties
static Scalar | One`[get]`
| Returns a scalar with value 1.
static Scalar | Zero`[get]`
| Returns a scalar with value 0.
bool | IsNaN`[get]`
| Indicates whether the current `Scalar` is not a number.
bool | IsPositiveInfinity`[get]`
| Indicates whether the current `Scalar` represents positive infinity.
bool | IsNegativeInfinity`[get]`
| Indicates whether the current `Scalar` represents negative infinity.
bool | IsInfinity`[get]`
| Indicates whether the current `Scalar` represents infinity.

## Detailed Description

Represents a real number.

## Constructor & Destructor Documentation

IG::Num::Scalar::Scalar | ( | Scalar | v | ) | `[inline]`

IG::Num::Scalar::Scalar | ( | double | v | ) | `[inline]`

## Member Function Documentation

void IG::Num::Scalar::Copy | ( | Scalar | s | ) | `[inline]`

Copies a scalar to the current scalar.

void IG::Num::Scalar::Copy | ( | double | d | ) | `[inline]`

Copies double to the current scalar.

static void IG::Num::Scalar::Copy | ( | Scalar | a,
|  | ref Scalar | res
| ) |  | `[inline, static]`

Copies a scalar to another (existing) scalar in place.

Parameters:

  a | Scalar that is copied.
  res | Scalar where result is stored.

static void IG::Num::Scalar::Copy | ( | double | a,
|  | ref Scalar | res
| ) |  | `[inline, static]`

Copies a number to an (existing) scalar in place.

Parameters:

  a | Number that is copied.
  res | Scalar where result is stored.

static Scalar IG::Num::Scalar::NaN | ( |  | ) | `[inline, static]`

Creates a scalar that is not a number.

static Scalar IG::Num::Scalar::PositiveInfinity | ( |  | ) | `[inline, static]`

Creates a scalar that represents positive infinity.

static Scalar IG::Num::Scalar::NegativeInfinity | ( |  | ) | `[inline, static]`

Creates a scalar that represents negative infinity.

static Scalar IG::Num::Scalar::MinValue | ( |  | ) | `[inline, static]`

Creates a scalar that contains minimal representable value.

static Scalar IG::Num::Scalar::MaxValue | ( |  | ) | `[inline, static]`

Creates a scalar that contains maximal representable value.

static Scalar IG::Num::Scalar::Epsilon | ( |  | ) | `[inline, static]`

Creates a scalar that contains the smallest positive value greater than 0.

int IG::Num::Scalar::Compare | ( | Scalar | a,
|  | Scalar | b
| ) |  | `[inline]`

override bool IG::Num::Scalar::Equals | ( | object | obj | ) | `[inline]`

Indicates whether `obj` is equal to this instance.

bool IG::Num::Scalar::Equals | ( | Scalar | a | ) | `[inline]`

Indicates whether `a` is equal to this instance.

override int IG::Num::Scalar::GetHashCode | ( |  | ) | `[inline]`

Gets the hashcode of this `Scalar`.

int IG::Num::Scalar::CompareTo | ( | Scalar | other | ) | `[inline]`

Compare this Scalar with another Scalar.

Parameters:

  s | The scalar to compare with.

static Scalar IG::Num::Scalar::operator+ | ( | Scalar | s | ) | `[inline, static]`

static Scalar IG::Num::Scalar::operator- | ( | Scalar | s | ) | `[inline, static]`

static Scalar IG::Num::Scalar::operator+ | ( | Scalar | a,
|  | Scalar | b
| ) |  | `[inline, static]`

static Scalar IG::Num::Scalar::operator- | ( | Scalar | a,
|  | Scalar | b
| ) |  | `[inline, static]`

static Scalar IG::Num::Scalar::operator* | ( | Scalar | a,
|  | Scalar | b
| ) |  | `[inline, static]`

static Scalar IG::Num::Scalar::operator/ | ( | Scalar | a,
|  | Scalar | b
| ) |  | `[inline, static]`

static bool IG::Num::Scalar::operator== | ( | Scalar | a,
|  | Scalar | b
| ) |  | `[inline, static]`

static bool IG::Num::Scalar::operator!= | ( | Scalar | a,
|  | Scalar | b
| ) |  | `[inline, static]`

static bool IG::Num::Scalar::operator< | ( | Scalar | a,
|  | Scalar | b
| ) |  | `[inline, static]`

static bool IG::Num::Scalar::operator> | ( | Scalar | a,
|  | Scalar | b
| ) |  | `[inline, static]`

static bool IG::Num::Scalar::operator<= | ( | Scalar | a,
|  | Scalar | b
| ) |  | `[inline, static]`

static bool IG::Num::Scalar::operator>= | ( | Scalar | a,
|  | Scalar | b
| ) |  | `[inline, static]`

static implicit IG::Num::Scalar::operator double | ( | Scalar | a | ) | `[inline, static]`

Implicit conversion from Scalar to double.

static implicit IG::Num::Scalar::operator Scalar | ( | double | a | ) | `[inline, static]`

Implicit conversion from double to Scalar.

override string IG::Num::Scalar::ToString | ( |  | ) | `[inline]`

Returns standard string representation of a scalar, with decimal point and e for exponent, no 1000 separators, number of digits according to type accuracy.

Returns:
  String representing te scalar.

string IG::Num::Scalar::ToString | ( | string | format,
|  | IFormatProvider | formatProvider
| ) |  | `[inline]`

Returns a string representation of a scalar in the specified way.

Parameters:

  format | the format string.
  formatProvider | The bormat provider used.

Returns:
  String representation of the scalar.

static int IG::Num::Scalar::Read | ( | ref Scalar | result,
|  | string | str
| ) |  | `[inline, static]`

Reads a scalar from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.

Parameters:

  result | Output parameter returning the scalar that was read.
  str | String from which the scalar is read.

Returns:
  Position right after the read scalar, or -1 if reading was not successful.

static int IG::Num::Scalar::Read | ( | ref Scalar | result,
|  | string | str,
|  | int | startpos
| ) |  | `[inline, static]`

Reads a scalar from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.

Parameters:

  result | Output parameter returning the scalar that was read.
  str | String from which the scalar is read.
  startpos | Starting position from which scalar is searched for.

at the starting position.

Returns:
  Position right after the read scalar, or -1 if reading was not successful.

static int IG::Num::Scalar::Read | ( | ref Scalar | result,
|  | string | str,
|  | int | startpos,
|  | bool | skipspaces
| ) |  | `[inline, static]`

Reads a scalar from a string, starting at a specified position. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.

Parameters:

  result | Output parameter returning the scalar that was read.
  str | String from which the scalar is read.
  startpos | Starting position from which scalar is searched for.
  skipspaces | If true then leading spaces are ignored, otherwise operation fails if there is a whitespace at the starting position.

Returns:
  Position right after the read scalar, or -1 if reading was not successful.

static Scalar IG::Num::Scalar::Parse | ( | string | str | ) | `[inline, static]`

Parses a scalar from a string and returns it. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a scalar.

Parameters:

  str | String that is parsed.

Returns:
  The scalar represented by the parsed string.

static bool IG::Num::Scalar::TryParse | ( | string | str,
|  | ref Scalar | result
| ) |  | `[inline, static]`

Parses a scalar from a string and returns it. Leading and trailing spaces are ignored, but other characters are not. false is returned if parsing was not successful, but no exception is thrown in this case.

Parameters:

  str | String that is parsed.

Returns:
  True if parsing was successful (and the scalar was actually read), false otherwise.

int IG::Num::Scalar::read | ( | string | str | ) | `[inline]`

Reads in the value from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.

Parameters:

  str | String from which the scalar is read.

Returns:
  Position right after the read scalar, or -1 if reading was not successful.

int IG::Num::Scalar::Read | ( | string | str,
|  | int | startpos
| ) |  | `[inline]`

Reads in the value from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.

Parameters:

  result | Output parameter returning the scalar that was read.
  str | String from which the scalar is read.
  startpos | Starting position from which scalar is searched for.

at the starting position.

Returns:
  Position right after the read scalar, or -1 if reading was not successful.

int IG::Num::Scalar::Read | ( | string | str,
|  | int | startpos,
|  | bool | skipspaces
| ) |  | `[inline]`

Reads in the value from a string, starting at a specified position. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.

Parameters:

  str | String from which the scalar is read.
  startpos | Starting position from which scalar is searched for.
  skipspaces | If true then leading spaces are ignored, otherwise operation fails if there is a whitespace at the starting position.

Returns:
  Position right after the read scalar, or -1 if reading was not successful.

void IG::Num::Scalar::Copy | ( | string | str | ) | `[inline]`

Parses a scalar from a string and sets the value to the parsed scalar. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a scalar.

Parameters:

  str | String that is parsed.

bool IG::Num::Scalar::TryCopy | ( | string | str | ) | `[inline]`

Parses a scalar from a string and sets the value to the parsed scalar. Leading and trailing spaces are ignored, but other characters are not. false is returned if parsing was not successful, but no exception is thrown in this case.

Parameters:

  str | String that is parsed.

Returns:
  True if parsing was successful (and the scalar was actually read), false otherwise.

static void IG::Num::Scalar::Examples | ( |  | ) | `[inline, static]`

Examples of using the Scalar class.

## Member Data Documentation

double IG::Num::Scalar::Value

Value of the scalar.

## Property Documentation

Scalar IG::Num::Scalar::One`[static, get]`

Returns a scalar with value 1.

Scalar IG::Num::Scalar::Zero`[static, get]`

Returns a scalar with value 0.

bool IG::Num::Scalar::IsNaN`[get]`

Indicates whether the current `Scalar` is not a number.

bool IG::Num::Scalar::IsPositiveInfinity`[get]`

Indicates whether the current `Scalar` represents positive infinity.

bool IG::Num::Scalar::IsNegativeInfinity`[get]`

Indicates whether the current `Scalar` represents negative infinity.

bool IG::Num::Scalar::IsInfinity`[get]`

Indicates whether the current `Scalar` represents infinity.

The documentation for this struct was generated from the following file:

- Scalar.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events