C# Класс YAMP.ScalarValue

A scalar value, which is a complex double type.
Наследование: NumericValue
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
RegisterOperators ( ) : void

Registers all operators that are associated with the scalar.

Приватные методы

Метод Описание
IsPrimeNumber ( int n ) : bool
IsProbablyPrime ( int n, int m, int s, int d, int w ) : bool
PowMod ( int b, int e, int m ) : int

Описание методов

Abs() публичный Метод

Computes the absolute value of the current scalar.
public Abs ( ) : double
Результат double

AbsSquare() публичный Метод

Computes the absolute value squared of the current scalar.
public AbsSquare ( ) : double
Результат double

Add() публичный статический Метод

Scalar + Scalar
public static Add ( Value left, Value right ) : ScalarValue
left Value Must be a scalar.
right Value Must be a scalar.
Результат ScalarValue

Arccos() публичный Метод

Computes the inverse cosine of the scalar (arccos).
public Arccos ( ) : ScalarValue
Результат ScalarValue

Arccot() публичный Метод

Computes the inverse cotangent of the scalar (arccot).
public Arccot ( ) : ScalarValue
Результат ScalarValue

Arccsc() публичный Метод

Computes the inverse cosecant of the scalar (arccsc).
public Arccsc ( ) : ScalarValue
Результат ScalarValue

Arcsec() публичный Метод

Computes the inverse secant of the scalar (arcsec).
public Arcsec ( ) : ScalarValue
Результат ScalarValue

Arcsin() публичный Метод

Computes the inverse sine of the scalar (arcsin).
public Arcsin ( ) : ScalarValue
Результат ScalarValue

Arctan() публичный Метод

Computes the inverse tangent of the scalar (arctan).
public Arctan ( ) : ScalarValue
Результат ScalarValue

Arg() публичный Метод

Computes Atan2(imaginary, real), i.e. the angle in the complex (gaussian) plane.
public Arg ( ) : double
Результат double

Clear() публичный Метод

Resets the current value.
public Clear ( ) : void
Результат void

Clone() публичный Метод

Copies the current instance.
public Clone ( ) : ScalarValue
Результат ScalarValue

ComplexSquare() публичный Метод

Computes z^* x z = |z|^2, which is AbsSquare().
public ComplexSquare ( ) : ScalarValue
Результат ScalarValue

Conjugate() публичный Метод

Conjugates the current scalar value, i.e. switches the sign of the imaginary value.
public Conjugate ( ) : ScalarValue
Результат ScalarValue

Copy() публичный Метод

Copies the current instance.
public Copy ( ) : Value
Результат Value

Cos() публичный Метод

Takes the cosine of the scalar.
public Cos ( ) : ScalarValue
Результат ScalarValue

Cot() публичный Метод

Takes the co-tangent (cos / sin) of the scalar.
public Cot ( ) : ScalarValue
Результат ScalarValue

Deserialize() публичный Метод

Transforms a binary representation into a new instance.
public Deserialize ( byte content ) : Value
content byte The binary data.
Результат Value

Divide() публичный статический Метод

Scalar / Scalar
public static Divide ( Value left, Value right ) : ScalarValue
left Value Must be a scalar.
right Value Must be a scalar.
Результат ScalarValue

Equals() публичный Метод

Is the given object equal to this.
public Equals ( object obj ) : bool
obj object The compare object.
Результат bool

Exp() публичный Метод

Takes the exponential of the scalar.
public Exp ( ) : ScalarValue
Результат ScalarValue

Factorial() публичный Метод

Computes the factorial of the scalar.
public Factorial ( ) : ScalarValue
Результат ScalarValue

GetHashCode() публичный Метод

Computes the hashcode of the value inside.
public GetHashCode ( ) : int
Результат int

GetIntegerOrThrowException() публичный Метод

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.
Результат int

GetLengthOfString() публичный Метод

Gets the length of the output in the given parse context.
public GetLengthOfString ( ParseContext context ) : Int32
context ParseContext The query context to consider.
Результат System.Int32

Ln() публичный Метод

Takes the natural logarithm of the scalar.
public Ln ( ) : ScalarValue
Результат ScalarValue

Log() публичный Метод

Takes the natural logarithm of the scalar.
public Log ( ) : ScalarValue
Результат ScalarValue

Log() публичный Метод

Takes the general logarithm of the scalar.
public Log ( double basis ) : ScalarValue
basis double The basis to use for the logarithm.
Результат ScalarValue

Log10() публичный Метод

Takes the base-10 logarithm of the scalar.
public Log10 ( ) : ScalarValue
Результат ScalarValue

Mod() публичный статический Метод

Scalar % Scalar
public static Mod ( Value left, Value right ) : ScalarValue
left Value Must be a scalar.
right Value Must be a scalar.
Результат ScalarValue

Multiply() публичный статический Метод

Scalar * Scalar
public static Multiply ( Value left, Value right ) : ScalarValue
left Value Must be a scalar.
right Value Must be a scalar.
Результат ScalarValue

Pow() публичный Метод

Raises the scalar to the specified power.
public Pow ( ScalarValue exponent ) : ScalarValue
exponent ScalarValue The exponent for raising the scalar.
Результат ScalarValue

Pow() публичный статический Метод

Scalar ^ Scalar
public static Pow ( Value basis, Value exponent ) : ScalarValue
basis Value Must be a scalar.
exponent Value Must be a scalar.
Результат ScalarValue

RegisterOperators() защищенный Метод

Registers all operators that are associated with the scalar.
protected RegisterOperators ( ) : void
Результат void

ScalarValue() публичный Метод

Creates a new empty scalar value.
public ScalarValue ( ) : System
Результат System

ScalarValue() публичный Метод

Creates a new scalar value from the given one.
public ScalarValue ( ScalarValue value ) : System
value ScalarValue Copies the contents of the given value.
Результат System

ScalarValue() публичный Метод

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.
Результат System

ScalarValue() публичный Метод

Creates a new scalar value which is real.
public ScalarValue ( double real ) : System
real double The real value.
Результат System

ScalarValue() публичный Метод

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.
Результат System

Serialize() публичный Метод

Transforms the instance into a binary representation.
public Serialize ( ) : byte[]
Результат byte[]

Sign() публичный Метод

Gives the signum of the scalar.
public Sign ( ) : ScalarValue
Результат ScalarValue

Sin() публичный Метод

Takes the sine of the scalar.
public Sin ( ) : ScalarValue
Результат ScalarValue

Sqrt() публичный Метод

Takes the square root of the scalar.
public Sqrt ( ) : ScalarValue
Результат ScalarValue

Square() публичный Метод

Computes z x z = z^2.
public Square ( ) : ScalarValue
Результат ScalarValue

Subtract() публичный статический Метод

Scalar - Scalar
public static Subtract ( Value left, Value right ) : ScalarValue
left Value Must be a scalar.
right Value Must be a scalar.
Результат ScalarValue

Tan() публичный Метод

Takes the tangent (sin / cos) of the scalar.
public Tan ( ) : ScalarValue
Результат ScalarValue

ToString() публичный Метод

Uses the standard string representation.
public ToString ( ParseContext context ) : String
context ParseContext The context to use.
Результат String

ToString() публичный Метод

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.
Результат String

operator() публичный статический Метод

a % b.
public static operator ( ) : ScalarValue
Результат ScalarValue

operator() публичный статический Метод

l != r.
public static operator ( ) : bool
Результат bool