IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Num.Scalar Struct Reference

Represents a real number. More...

+ Inheritance diagram for IG.Num.Scalar:
+ Collaboration diagram for IG.Num.Scalar:

Public Member Functions

 Scalar (Scalar v)
 
 Scalar (double v)
 
void Copy (Scalar s)
 Copies a scalar to the current scalar. More...
 
void Copy (double d)
 Copies double to the current scalar. More...
 
int Compare (Scalar a, Scalar b)
 
override bool Equals (object obj)
 Indicates whether obj is equal to this instance. More...
 
bool Equals (Scalar a)
 Indicates whether a is equal to this instance. More...
 
override int GetHashCode ()
 Gets the hashcode of this Scalar. More...
 
int CompareTo (Scalar other)
 Compare this Scalar with another Scalar. More...
 
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. More...
 
string ToString (string format, IFormatProvider formatProvider)
 Returns a string representation of a scalar in the specified way. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Static Public Member Functions

static void Copy (Scalar a, ref Scalar res)
 Copies a scalar to another (existing) scalar in place. More...
 
static void Copy (double a, ref Scalar res)
 Copies a number to an (existing) scalar in place. More...
 
static Scalar NaN ()
 Creates a scalar that is not a number. More...
 
static Scalar PositiveInfinity ()
 Creates a scalar that represents positive infinity. More...
 
static Scalar NegativeInfinity ()
 Creates a scalar that represents negative infinity. More...
 
static Scalar MinValue ()
 Creates a scalar that contains minimal representable value. More...
 
static Scalar MaxValue ()
 Creates a scalar that contains maximal representable value. More...
 
static Scalar Epsilon ()
 Creates a scalar that contains the smallest positive value greater than 0. More...
 
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. More...
 
static implicit operator Scalar (double a)
 Implicit conversion from double to Scalar. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
static void Examples ()
 Examples of using the Scalar class More...
 

Public Attributes

double Value
 Value of the scalar. More...
 

Properties

static Scalar One [get]
 Returns a scalar with value 1. More...
 
static Scalar Zero [get]
 Returns a scalar with value 0. More...
 
bool IsNaN [get]
 Indicates whether the current Scalar is not a number. More...
 
bool IsPositiveInfinity [get]
 Indicates whether the current Scalar represents positive infinity. More...
 
bool IsNegativeInfinity [get]
 Indicates whether the current Scalar represents negative infinity. More...
 
bool IsInfinity [get]
 Indicates whether the current Scalar represents infinity. More...
 

Detailed Description

Represents a real number.

Constructor & Destructor Documentation

IG.Num.Scalar.Scalar ( Scalar  v)
inline

References IG.Num.Scalar.Value.

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.

References IG.Num.Scalar.Value.

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 
)
inlinestatic

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

Parameters
aScalar that is copied.
resScalar where result is stored.

References IG.Num.Scalar.Value.

static void IG.Num.Scalar.Copy ( double  a,
ref Scalar  res 
)
inlinestatic

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

Parameters
aNumber that is copied.
resScalar where result is stored.
static Scalar IG.Num.Scalar.NaN ( )
inlinestatic

Creates a scalar that is not a number.

static Scalar IG.Num.Scalar.PositiveInfinity ( )
inlinestatic

Creates a scalar that represents positive infinity.

static Scalar IG.Num.Scalar.NegativeInfinity ( )
inlinestatic

Creates a scalar that represents negative infinity.

static Scalar IG.Num.Scalar.MinValue ( )
inlinestatic

Creates a scalar that contains minimal representable value.

static Scalar IG.Num.Scalar.MaxValue ( )
inlinestatic

Creates a scalar that contains maximal representable value.

static Scalar IG.Num.Scalar.Epsilon ( )
inlinestatic

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

int IG.Num.Scalar.Compare ( Scalar  a,
Scalar  b 
)
inline

References IG.Num.Scalar.Value.

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.

References IG.Num.Scalar.IsNaN, and IG.Num.Scalar.Value.

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
otherThe scalar to compare with.
static Scalar IG.Num.Scalar.operator+ ( Scalar  s)
inlinestatic

References IG.Num.Scalar.Value.

static Scalar IG.Num.Scalar.operator- ( Scalar  s)
inlinestatic

References IG.Num.Scalar.Value.

static Scalar IG.Num.Scalar.operator+ ( Scalar  a,
Scalar  b 
)
inlinestatic

References IG.Num.Scalar.Value.

static Scalar IG.Num.Scalar.operator- ( Scalar  a,
Scalar  b 
)
inlinestatic

References IG.Num.Scalar.Value.

static Scalar IG.Num.Scalar.operator* ( Scalar  a,
Scalar  b 
)
inlinestatic

References IG.Num.Scalar.Value.

static Scalar IG.Num.Scalar.operator/ ( Scalar  a,
Scalar  b 
)
inlinestatic

References IG.Num.Scalar.Value.

static bool IG.Num.Scalar.operator== ( Scalar  a,
Scalar  b 
)
inlinestatic

References IG.Num.Scalar.Value.

static bool IG.Num.Scalar.operator!= ( Scalar  a,
Scalar  b 
)
inlinestatic

References IG.Num.Scalar.Value.

static bool IG.Num.Scalar.operator< ( Scalar  a,
Scalar  b 
)
inlinestatic

References IG.Num.Scalar.Value.

static bool IG.Num.Scalar.operator> ( Scalar  a,
Scalar  b 
)
inlinestatic

References IG.Num.Scalar.Value.

static bool IG.Num.Scalar.operator<= ( Scalar  a,
Scalar  b 
)
inlinestatic

References IG.Num.Scalar.Value.

static bool IG.Num.Scalar.operator>= ( Scalar  a,
Scalar  b 
)
inlinestatic

References IG.Num.Scalar.Value.

static implicit IG.Num.Scalar.operator double ( Scalar  a)
inlinestatic

Implicit conversion from Scalar to double.

References IG.Num.Scalar.Value.

static implicit IG.Num.Scalar.operator Scalar ( double  a)
inlinestatic

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.

Referenced by IG.Num.Scalar.Examples().

string IG.Num.Scalar.ToString ( string  format,
IFormatProvider  formatProvider 
)
inline

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

Parameters
formatthe format string.
formatProviderThe bormat provider used.
Returns
String representation of the scalar.
static int IG.Num.Scalar.Read ( ref Scalar  result,
string  str 
)
inlinestatic

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
resultOutput parameter returning the scalar that was read.
strString 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 
)
inlinestatic

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
resultOutput parameter returning the scalar that was read.
strString from which the scalar is read.
startposStarting position from which scalar is searched for.
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 
)
inlinestatic

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
resultOutput parameter returning the scalar that was read.
strString from which the scalar is read.
startposStarting position from which scalar is searched for.
skipspacesIf 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.

References IG.Lib.Parser.ReadNumber().

static Scalar IG.Num.Scalar.Parse ( string  str)
inlinestatic

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
strString that is parsed.
Returns
The scalar represented by the parsed string.

References IG.Num.s, and IG.Lib.Parser.SkipSpaces().

static bool IG.Num.Scalar.TryParse ( string  str,
ref Scalar  result 
)
inlinestatic

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
strString that is parsed.
resultVariable where result of the operation is stored.
Returns
True if parsing was successful (and the scalar was actually read), false otherwise.

References IG.Num.s, and IG.Lib.Parser.SkipSpaces().

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
strString 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
strString from which the scalar is read.
startposStarting position from which scalar is searched for.
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
strString from which the scalar is read.
startposStarting position from which scalar is searched for.
skipspacesIf 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
strString that is parsed.

References IG.Num.s.

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
strString that is parsed.
Returns
True if parsing was successful (and the scalar was actually read), false otherwise.
static void IG.Num.Scalar.Examples ( )
inlinestatic

Examples of using the Scalar class

References IG.Num.Scalar.ToString().

Member Data Documentation

Property Documentation

Scalar IG.Num.Scalar.One
staticget

Returns a scalar with value 1.

Scalar IG.Num.Scalar.Zero
staticget

Returns a scalar with value 0.

bool IG.Num.Scalar.IsNaN
get

Indicates whether the current Scalar is not a number.

Referenced by IG.Num.Scalar.Equals().

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: