Record TRVector

Unit

Declaration

type generic TRVector<TSpace> = record

Description

Generic column vector of real values (double) with TSpace.N components.

Components are stored in a 1-based array. Use the default array property a[row] to read and write individual components. Concrete types are provided as TR2Vector, TR3Vector, and TR4Vector.

Overview

Nested Types

Public TRMatrix = specialize TRMatrix<TSpace>;

Methods

Public function IsNotNull: boolean;
Public function IsNull: boolean;
Public function Norm: double;
Public function Normalize: TRVector;
Public function Reciprocal: TRVector;
Public function SquaredNorm: double;
Public class operator *(const ALeft: double; const ARight: TRVector): TRVector;
Public class operator *(const ALeft: TRMatrix; const ARight: TRVector): TRVector;
Public class operator *(const ALeft: TRVector; const ARight: double): TRVector;
Public class operator *(const ALeft: TRVector; const ARight: TRMatrix): TRVector;
Public class operator *(const ALeft, ARight: TRVector): double;
Public class operator +(const ASelf: TRVector): TRVector;
Public class operator +(const ALeft, ARight: TRVector): TRVector;
Public class operator -(const ASelf: TRVector): TRVector;
Public class operator -(const ALeft, ARight: TRVector): TRVector;
Public class operator /(const ALeft: double; const ARight: TRVector): TRVector;
Public class operator /(const ALeft: TRVector; const ARight: double): TRVector;
Public class operator <>(const ALeft, ARight: TRVector): boolean;
Public class operator =(const ALeft, ARight: TRVector): boolean;

Properties

Public property a[ARow: longint]: double read Get write Put; default;

Description

Nested Types

Public TRMatrix = specialize TRMatrix<TSpace>;

This item has no description.

Methods

Public function IsNotNull: boolean;

Returns True if at least one component is non-zero.

Public function IsNull: boolean;

Returns True if all components are zero.

Public function Norm: double;

Returns the Euclidean norm (magnitude) of the vector. |v| = √(Σ vᵢ²)

Public function Normalize: TRVector;

Returns the unit vector in the same direction. Each component is divided by Norm.

Public function Reciprocal: TRVector;

Returns the element-wise reciprocal of the vector. Each component vᵢ is replaced by 1/vᵢ.

Public function SquaredNorm: double;

Returns the squared Euclidean norm of the vector. |v|² = Σ vᵢ². Avoids the square root of Norm.

Public class operator *(const ALeft: double; const ARight: TRVector): TRVector;

Returns the product of a real scalar and a vector. Each component is multiplied by ALeft.

Public class operator *(const ALeft: TRMatrix; const ARight: TRVector): TRVector;

Returns the product of a square matrix and a column vector: v' = A·v. The result is a column vector.

Public class operator *(const ALeft: TRVector; const ARight: double): TRVector;

Returns the product of a vector and a real scalar. Each component is multiplied by ARight.

Public class operator *(const ALeft: TRVector; const ARight: TRMatrix): TRVector;

Returns the product of a row vector and a square matrix: v' = v·A. The result is a row vector.

Public class operator *(const ALeft, ARight: TRVector): double;

Returns the dot product (inner product) of two vectors. u·v = Σ uᵢ·vᵢ

Public class operator +(const ASelf: TRVector): TRVector;

Unary plus. Returns the vector unchanged.

Public class operator +(const ALeft, ARight: TRVector): TRVector;

Returns the component-wise sum of two vectors.

Public class operator -(const ASelf: TRVector): TRVector;

Unary minus. Returns the negation of the vector: each component vᵢ becomes -vᵢ.

Public class operator -(const ALeft, ARight: TRVector): TRVector;

Returns the component-wise difference of two vectors.

Public class operator /(const ALeft: double; const ARight: TRVector): TRVector;

Returns the element-wise quotient of a scalar divided by a vector: each component becomes ALeft/vᵢ.

Public class operator /(const ALeft: TRVector; const ARight: double): TRVector;

Returns the vector divided by a real scalar. Each component is divided by ARight.

Public class operator <>(const ALeft, ARight: TRVector): boolean;

Returns True if the two vectors differ in at least one component.

Public class operator =(const ALeft, ARight: TRVector): boolean;

Returns True if all corresponding components of the two vectors are equal.

Properties

Public property a[ARow: longint]: double read Get write Put; default;

Provides access to individual vector components using a 1-based index. a[1] is the first component.


Generated by PasDoc 1.0.4.