C# Class YAMP.ScalarValue

A scalar value, which is a complex double type.
Inheritance: NumericValue
Afficher le fichier Open project: FlorianRappl/YAMP Class Usage Examples

Méthodes publiques

Méthode Description
Abs ( ) : double

Computes the absolute value of the current scalar.

AbsSquare ( ) : double

Computes the absolute value squared of the current scalar.

Add ( Value left, Value right ) : ScalarValue

Scalar + Scalar

Arccos ( ) : ScalarValue

Computes the inverse cosine of the scalar (arccos).

Arccot ( ) : ScalarValue

Computes the inverse cotangent of the scalar (arccot).

Arccsc ( ) : ScalarValue

Computes the inverse cosecant of the scalar (arccsc).

Arcsec ( ) : ScalarValue

Computes the inverse secant of the scalar (arcsec).

Arcsin ( ) : ScalarValue

Computes the inverse sine of the scalar (arcsin).

Arctan ( ) : ScalarValue

Computes the inverse tangent of the scalar (arctan).

Arg ( ) : double

Computes Atan2(imaginary, real), i.e. the angle in the complex (gaussian) plane.

Clear ( ) : void

Resets the current value.

Clone ( ) : ScalarValue

Copies the current instance.

ComplexSquare ( ) : ScalarValue

Computes z^* x z = |z|^2, which is AbsSquare().

Conjugate ( ) : ScalarValue

Conjugates the current scalar value, i.e. switches the sign of the imaginary value.

Copy ( ) : Value

Copies the current instance.

Cos ( ) : ScalarValue

Takes the cosine of the scalar.

Cot ( ) : ScalarValue

Takes the co-tangent (cos / sin) of the scalar.

Deserialize ( byte content ) : Value

Transforms a binary representation into a new instance.

Divide ( Value left, Value right ) : ScalarValue

Scalar / Scalar

Equals ( object obj ) : bool

Is the given object equal to this.

Exp ( ) : ScalarValue

Takes the exponential of the scalar.

Factorial ( ) : ScalarValue

Computes the factorial of the scalar.

GetHashCode ( ) : int

Computes the hashcode of the value inside.

GetIntegerOrThrowException ( String argumentName, String functionName ) : int

Gets the integer value or throws an exception if either the imaginary part is not 0 or the real part is not integer.

GetLengthOfString ( ParseContext context ) : Int32

Gets the length of the output in the given parse context.

Ln ( ) : ScalarValue

Takes the natural logarithm of the scalar.

Log ( ) : ScalarValue

Takes the natural logarithm of the scalar.

Log ( double basis ) : ScalarValue

Takes the general logarithm of the scalar.

Log10 ( ) : ScalarValue

Takes the base-10 logarithm of the scalar.

Mod ( Value left, Value right ) : ScalarValue

Scalar % Scalar

Multiply ( Value left, Value right ) : ScalarValue

Scalar * Scalar

Pow ( ScalarValue exponent ) : ScalarValue

Raises the scalar to the specified power.

Pow ( Value basis, Value exponent ) : ScalarValue

Scalar ^ Scalar

ScalarValue ( ) : System

Creates a new empty scalar value.

ScalarValue ( ScalarValue value ) : System

Creates a new scalar value from the given one.

ScalarValue ( bool boolean ) : System

Creates a new scalar value from a boolean, i.e. 1.0 or 0.0.

ScalarValue ( double real ) : System

Creates a new scalar value which is real.

ScalarValue ( double real, double imag ) : System

Creates a new scalar value with the given complex parameters.

Serialize ( ) : byte[]

Transforms the instance into a binary representation.

Sign ( ) : ScalarValue

Gives the signum of the scalar.

Sin ( ) : ScalarValue

Takes the sine of the scalar.

Sqrt ( ) : ScalarValue

Takes the square root of the scalar.

Square ( ) : ScalarValue

Computes z x z = z^2.

Subtract ( Value left, Value right ) : ScalarValue

Scalar - Scalar

Tan ( ) : ScalarValue

Takes the tangent (sin / cos) of the scalar.

ToString ( ParseContext context ) : String

Uses the standard string representation.

ToString ( ParseContext context, Int32 exponent ) : String

Use this string representation if you have a global exponent like everything is already e5 or similar. In this case the values get multiplied with e-5 for the output.

operator ( ) : ScalarValue

a % b.

operator ( ) : bool

l != r.

Méthodes protégées

Méthode Description
RegisterOperators ( ) : void

Registers all operators that are associated with the scalar.

Private Methods

Méthode Description
IsPrimeNumber ( int n ) : bool
IsProbablyPrime ( int n, int m, int s, int d, int w ) : bool
PowMod ( int b, int e, int m ) : int

Method Details

Abs() public méthode

Computes the absolute value of the current scalar.
public Abs ( ) : double
Résultat double

AbsSquare() public méthode

Computes the absolute value squared of the current scalar.
public AbsSquare ( ) : double
Résultat double

Add() public static méthode

Scalar + Scalar
public static Add ( Value left, Value right ) : ScalarValue
left Value Must be a scalar.
right Value Must be a scalar.
Résultat ScalarValue

Arccos() public méthode

Computes the inverse cosine of the scalar (arccos).
public Arccos ( ) : ScalarValue
Résultat ScalarValue

Arccot() public méthode

Computes the inverse cotangent of the scalar (arccot).
public Arccot ( ) : ScalarValue
Résultat ScalarValue

Arccsc() public méthode

Computes the inverse cosecant of the scalar (arccsc).
public Arccsc ( ) : ScalarValue
Résultat ScalarValue

Arcsec() public méthode

Computes the inverse secant of the scalar (arcsec).
public Arcsec ( ) : ScalarValue
Résultat ScalarValue

Arcsin() public méthode

Computes the inverse sine of the scalar (arcsin).
public Arcsin ( ) : ScalarValue
Résultat ScalarValue

Arctan() public méthode

Computes the inverse tangent of the scalar (arctan).
public Arctan ( ) : ScalarValue
Résultat ScalarValue

Arg() public méthode

Computes Atan2(imaginary, real), i.e. the angle in the complex (gaussian) plane.
public Arg ( ) : double
Résultat double

Clear() public méthode

Resets the current value.
public Clear ( ) : void
Résultat void

Clone() public méthode

Copies the current instance.
public Clone ( ) : ScalarValue
Résultat ScalarValue

ComplexSquare() public méthode

Computes z^* x z = |z|^2, which is AbsSquare().
public ComplexSquare ( ) : ScalarValue
Résultat ScalarValue

Conjugate() public méthode

Conjugates the current scalar value, i.e. switches the sign of the imaginary value.
public Conjugate ( ) : ScalarValue
Résultat ScalarValue

Copy() public méthode

Copies the current instance.
public Copy ( ) : Value
Résultat Value

Cos() public méthode

Takes the cosine of the scalar.
public Cos ( ) : ScalarValue
Résultat ScalarValue

Cot() public méthode

Takes the co-tangent (cos / sin) of the scalar.
public Cot ( ) : ScalarValue
Résultat ScalarValue

Deserialize() public méthode

Transforms a binary representation into a new instance.
public Deserialize ( byte content ) : Value
content byte The binary data.
Résultat Value

Divide() public static méthode

Scalar / Scalar
public static Divide ( Value left, Value right ) : ScalarValue
left Value Must be a scalar.
right Value Must be a scalar.
Résultat ScalarValue

Equals() public méthode

Is the given object equal to this.
public Equals ( object obj ) : bool
obj object The compare object.
Résultat bool

Exp() public méthode

Takes the exponential of the scalar.
public Exp ( ) : ScalarValue
Résultat ScalarValue

Factorial() public méthode

Computes the factorial of the scalar.
public Factorial ( ) : ScalarValue
Résultat ScalarValue

GetHashCode() public méthode

Computes the hashcode of the value inside.
public GetHashCode ( ) : int
Résultat int

GetIntegerOrThrowException() public méthode

Gets the integer value or throws an exception if either the imaginary part is not 0 or the real part is not integer.
public GetIntegerOrThrowException ( String argumentName, String functionName ) : int
argumentName String The name of the variable that is requested.
functionName String The name of the function where this is requested.
Résultat int

GetLengthOfString() public méthode

Gets the length of the output in the given parse context.
public GetLengthOfString ( ParseContext context ) : Int32
context ParseContext The query context to consider.
Résultat System.Int32

Ln() public méthode

Takes the natural logarithm of the scalar.
public Ln ( ) : ScalarValue
Résultat ScalarValue

Log() public méthode

Takes the natural logarithm of the scalar.
public Log ( ) : ScalarValue
Résultat ScalarValue

Log() public méthode

Takes the general logarithm of the scalar.
public Log ( double basis ) : ScalarValue
basis double The basis to use for the logarithm.
Résultat ScalarValue

Log10() public méthode

Takes the base-10 logarithm of the scalar.
public Log10 ( ) : ScalarValue
Résultat ScalarValue

Mod() public static méthode

Scalar % Scalar
public static Mod ( Value left, Value right ) : ScalarValue
left Value Must be a scalar.
right Value Must be a scalar.
Résultat ScalarValue

Multiply() public static méthode

Scalar * Scalar
public static Multiply ( Value left, Value right ) : ScalarValue
left Value Must be a scalar.
right Value Must be a scalar.
Résultat ScalarValue

Pow() public méthode

Raises the scalar to the specified power.
public Pow ( ScalarValue exponent ) : ScalarValue
exponent ScalarValue The exponent for raising the scalar.
Résultat ScalarValue

Pow() public static méthode

Scalar ^ Scalar
public static Pow ( Value basis, Value exponent ) : ScalarValue
basis Value Must be a scalar.
exponent Value Must be a scalar.
Résultat ScalarValue

RegisterOperators() protected méthode

Registers all operators that are associated with the scalar.
protected RegisterOperators ( ) : void
Résultat void

ScalarValue() public méthode

Creates a new empty scalar value.
public ScalarValue ( ) : System
Résultat System

ScalarValue() public méthode

Creates a new scalar value from the given one.
public ScalarValue ( ScalarValue value ) : System
value ScalarValue Copies the contents of the given value.
Résultat System

ScalarValue() public méthode

Creates a new scalar value from a boolean, i.e. 1.0 or 0.0.
public ScalarValue ( bool boolean ) : System
boolean bool True for 1.0, False for 0.0.
Résultat System

ScalarValue() public méthode

Creates a new scalar value which is real.
public ScalarValue ( double real ) : System
real double The real value.
Résultat System

ScalarValue() public méthode

Creates a new scalar value with the given complex parameters.
public ScalarValue ( double real, double imag ) : System
real double The real part of the complex scalar.
imag double The imaginary part of the complex scalar.
Résultat System

Serialize() public méthode

Transforms the instance into a binary representation.
public Serialize ( ) : byte[]
Résultat byte[]

Sign() public méthode

Gives the signum of the scalar.
public Sign ( ) : ScalarValue
Résultat ScalarValue

Sin() public méthode

Takes the sine of the scalar.
public Sin ( ) : ScalarValue
Résultat ScalarValue

Sqrt() public méthode

Takes the square root of the scalar.
public Sqrt ( ) : ScalarValue
Résultat ScalarValue

Square() public méthode

Computes z x z = z^2.
public Square ( ) : ScalarValue
Résultat ScalarValue

Subtract() public static méthode

Scalar - Scalar
public static Subtract ( Value left, Value right ) : ScalarValue
left Value Must be a scalar.
right Value Must be a scalar.
Résultat ScalarValue

Tan() public méthode

Takes the tangent (sin / cos) of the scalar.
public Tan ( ) : ScalarValue
Résultat ScalarValue

ToString() public méthode

Uses the standard string representation.
public ToString ( ParseContext context ) : String
context ParseContext The context to use.
Résultat String

ToString() public méthode

Use this string representation if you have a global exponent like everything is already e5 or similar. In this case the values get multiplied with e-5 for the output.
public ToString ( ParseContext context, Int32 exponent ) : String
context ParseContext The parse context to use.
exponent System.Int32 The global exponent that is in use.
Résultat String

operator() public static méthode

a % b.
public static operator ( ) : ScalarValue
Résultat ScalarValue

operator() public static méthode

l != r.
public static operator ( ) : bool
Résultat bool