SourcePro C++ 13.0 |
SourcePro® C++ API Reference Guide |
Product Documentation: SourcePro C++ Documentation Home |
A templatized vector class. More...
#include <rw/math/mathvec.h>
Public Types | |
typedef RWMathVecConstIterator< T > | const_iterator |
typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
typedef RWMathVecIterator< T > | iterator |
typedef rw_numeric_traits< T > ::mathFunType | mathFunType |
typedef rw_numeric_traits< T > ::mathFunType2 | mathFunType2 |
typedef rw_numeric_traits< T > ::norm_type | norm_type |
typedef rw_numeric_traits< T > ::promote_type | promote_type |
typedef std::reverse_iterator < iterator > | reverse_iterator |
Friends | |
RWMathVec< double > | imag (const RWMathVec< DComplex > &v) |
RWMathVec< double > | real (const RWMathVec< DComplex > &v) |
Related Functions | |
(Note that these are not member functions.) | |
RWMathVec< double > | abs (const RWMathVec< double > &) |
RWMathVec< float > | abs (const RWMathVec< float > &) |
RWMathVec< int > | abs (const RWMathVec< int > &) |
RWMathVec< double > | abs (const RWMathVec< DComplex > &) |
RWMathVec< SChar > | abs (const RWMathVec< SChar > &) |
template<class T > | |
RWMathVec< T > | acos (const RWMathVec< T > &x) |
RWMathVec< double > | arg (const RWMathVec< DComplex > &v) |
template<class T > | |
RWMathVec< T > | asin (const RWMathVec< T > &x) |
template<class T > | |
RWMathVec< T > | atan (const RWMathVec< T > &x) |
template<class T > | |
RWMathVec< T > | atan2 (const RWMathVec< T > &x, const RWMathVec< T > &y) |
template<class T > | |
RWMathVec< T > | ceil (const RWMathVec< T > &x) |
RWMathVec< DComplex > | conj (const RWMathVec< DComplex > &x) |
DComplex | conjDot (const RWMathVec< DComplex > &x, const RWMathVec< DComplex > &y) |
template<class T > | |
RWMathVec< T > | cos (const RWMathVec< T > &x) |
template<class T > | |
RWMathVec< T > | cosh (const RWMathVec< T > &x) |
template<class T > | |
RWMathVec< T > | cumsum (const RWMathVec< T > &x) |
template<class T > | |
RWMathVec< T > | delta (const RWMathVec< T > &x) |
template<class T > | |
T | dot (const RWMathVec< T > &x, const RWMathVec< T > &y) |
template<class T > | |
RWMathVec< T > | exp (const RWMathVec< T > &x) |
RWMathVec< DComplex > | expandConjugateEven (const RWMathVec< DComplex > &) |
RWMathVec< DComplex > | expandConjugateOdd (const RWMathVec< DComplex > &) |
template<class T > | |
RWMathVec< T > | expandEven (const RWMathVec< T > &) |
template<class T > | |
RWMathVec< T > | expandOdd (const RWMathVec< T > &) |
template<class T > | |
RWMathVec< T > | floor (const RWMathVec< T > &V) |
double | frobNorm (const RWMathVec< double > &v) |
float | frobNorm (const RWMathVec< float > &v) |
More... | |
double | frobNorm (const RWMathVec< DComplex > &v) |
More... | |
double | kurtosis (const RWMathVec< double > &) |
double | l1Norm (const RWMathVec< double > &v) |
float | l1Norm (const RWMathVec< float > &v) |
More... | |
double | l1Norm (const RWMathVec< DComplex > &v) |
More... | |
double | l2Norm (const RWMathVec< double > &v) |
float | l2Norm (const RWMathVec< float > &v) |
More... | |
double | l2Norm (const RWMathVec< DComplex > &v) |
More... | |
double | linfNorm (const RWMathVec< double > &v) |
float | linfNorm (const RWMathVec< float > &v) |
More... | |
double | linfNorm (const RWMathVec< DComplex > &v) |
More... | |
template<class T > | |
RWMathVec< T > | log (const RWMathVec< T > &x) |
template<class T > | |
RWMathVec< T > | log10 (const RWMathVec< T > &x) |
template<class T > | |
int | maxIndex (const RWMathVec< T > &) |
double | maxNorm (const RWMathVec< double > &v) |
float | maxNorm (const RWMathVec< float > &v) |
More... | |
double | maxNorm (const RWMathVec< DComplex > &v) |
More... | |
template<class T > | |
T | maxValue (const RWMathVec< T > &) |
template<class T > | |
T | mean (const RWMathVec< T > &V) |
template<class T > | |
int | minIndex (const RWMathVec< T > &) |
template<class T > | |
T | minValue (const RWMathVec< T > &) |
RWMathVec< double > | norm (const RWMathVec< DComplex > &x) |
template<class T > | |
RWMathVec< T > | operator* (const RWMathVec< T > &u, const RWMathVec< T > &v) |
template<class T > | |
RWMathVec< T > | operator* (const RWMathVec< T > &u, const T &s) |
template<class T > | |
RWMathVec< T > | operator* (const T &s, const RWMathVec< T > &v) |
template<class T > | |
RWMathVec< T > | operator+ (const RWMathVec< T > &v) |
template<class T > | |
RWMathVec< T > | operator+ (const RWMathVec< T > &u, const RWMathVec< T > &v) |
template<class T > | |
RWMathVec< T > | operator+ (const RWMathVec< T > &u, const T &s) |
template<class T > | |
RWMathVec< T > | operator+ (const T &s, const RWMathVec< T > &v) |
template<class T > | |
RWMathVec< T > | operator- (const RWMathVec< T > &v) |
template<class T > | |
RWMathVec< T > | operator- (const RWMathVec< T > &u, const RWMathVec< T > &v) |
template<class T > | |
RWMathVec< T > | operator- (const T &s, const RWMathVec< T > &v) |
template<class T > | |
RWMathVec< T > | operator- (const RWMathVec< T > &u, const T &s) |
template<class T > | |
RWMathVec< T > | operator/ (const RWMathVec< T > &u, const RWMathVec< T > &v) |
template<class T > | |
RWMathVec< T > | operator/ (const T &s, const RWMathVec< T > &v) |
template<class T > | |
RWMathVec< T > | operator/ (const RWMathVec< T > &u, const T &s) |
template<class T > | |
std::ostream & | operator<< (std::ostream &s, const RWMathVec< T > &v) |
template<class T > | |
std::istream & | operator>> (std::istream &s, RWMathVec< T > &v) |
template<class T > | |
RWGenMat< T > | outerProduct (const RWMathVec< T > &x, const RWMathVec< T > &y) |
template<class T > | |
RWMathVec< T > | pow (const RWMathVec< T > &x, const RWMathVec< T > &y) |
template<class T > | |
RWMathVec< T > | pow (const RWMathVec< T > &x, T y) |
template<class T > | |
RWMathVec< T > | pow (T x, const RWMathVec< T > &y) |
template<class T > | |
T | prod (const RWMathVec< T > &) |
template<class T > | |
RWMathVec< T > | reverse (const RWMathVec< T > &) |
RWMathVec< DComplex > | rootsOfOne (int N, size_t nterms) |
Returns a complex vector v containing the complex Nth roots of unity. More... | |
RWMathVec< DComplex > | rootsOfOne (int N) |
Returns a complex vector v containing the complex Nth roots of unity. More... | |
template<class T > | |
RWMathVec< T > | sin (const RWMathVec< T > &V) |
template<class T > | |
RWMathVec< T > | sinh (const RWMathVec< T > &V) |
double | skewness (const RWMathVec< double > &) |
RWMathVec< double > | sort (const RWMathVec< double > &) |
double | spectralVariance (const RWMathVec< DComplex > &) |
template<class T > | |
RWMathVec< T > | sqrt (const RWMathVec< T > &V) |
template<class T > | |
T | sum (const RWMathVec< T > &) |
template<class T > | |
RWMathVec< T > | tan (const RWMathVec< T > &V) |
template<class T > | |
RWMathVec< T > | tanh (const RWMathVec< T > &V) |
RWMathVec< SChar > | toChar (const RWMathVec< int > &v) |
RWMathVec< float > | toFloat (const RWMathVec< double > &v) |
RWMathVec< int > | toInt (const RWMathVec< double > &v) |
RWMathVec< int > | toInt (const RWMathVec< float > &v) |
double | variance (const RWMathVec< double > &) |
double | variance (const RWMathVec< DComplex > &) |
More... | |
float | variance (const RWMathVec< float > &) |
More... | |
Class RWMathVec<T> is a templatized vector class.
typedef RWMathVecConstIterator<T> RWMathVec< T >::const_iterator |
A type that provides a const
random-access iterator over the elements in the container.
typedef std::reverse_iterator<const_iterator> RWMathVec< T >::const_reverse_iterator |
A type that provides a const
random-access, reverse-order iterator over the elements in the container.
typedef RWMathVecIterator<T> RWMathVec< T >::iterator |
A type that provides a random-access iterator over the elements in the container.
typedef rw_numeric_traits<T>::mathFunType RWMathVec< T >::mathFunType |
Typedef for the function pointer used in the method apply(). For more information, see rw_numeric_traits<T>::mathFunType.
typedef rw_numeric_traits<T>::mathFunType2 RWMathVec< T >::mathFunType2 |
Typedef for the function pointer used in the method apply2(). For more information, see rw_numeric_traits<T>::mathFunType2.
typedef rw_numeric_traits<T>::norm_type RWMathVec< T >::norm_type |
Typedef for the usual return type of numerical norm
-like functions. For more information, see rw_numeric_traits<T>::norm_type.
typedef rw_numeric_traits<T>::promote_type RWMathVec< T >::promote_type |
Typedef for the promotion type. For more information, see rw_numeric_traits<T>::promote_type.
typedef std::reverse_iterator<iterator> RWMathVec< T >::reverse_iterator |
A type that provides a random-access, reverse-order iterator over the elements in the container.
RWMathVec< T >::RWMathVec | ( | size_t | n, |
RWRandInterface & | r | ||
) |
Constructs a vector with n elements initialized with random numbers generated by r.
Copy constructor. The new vector and the old vector both view the same data.
|
inline |
Constructs a vector with n elements. The RWUninitialized type is an enumeration type with only one value, rwUninitialized. The rwUninitialized argument is used to distinguish the last dimension size from an initial value.
Constructs a vector with n elements, initialized to initval.
Constructs a vector with n elements. The first has value initval; each succeeding element is incremented by incr.
Constructs a matrix from the null terminated character string s. The format of the character string is the same as that expected by the global operator operator>>() described in this entry.
RWMathVec< T >::RWMathVec | ( | const RWMathVecPick< T > & | p | ) |
Constructs a new vector from an RWMathVecPick<T> . A copy of p's data is made.
Constructs a vector with n elements, using the data in the vector dat as initial data. A copy of dat is made. The vector dat must have at least n elements.
RWMathVec< T >::RWMathVec | ( | const RWMathVec< double > & | re, |
const RWMathVec< double > & | im | ||
) |
A complex vec
is constructed from the double precision arrays re and im, with the real part of the vec
equal to re and the imaginary part equal to im. A new copy of the data is made.
|
inline |
Returns the result of applying the passed function to every element in the vector. A function of type RWMathVec<T>::mathFunType takes and returns a T
; a function of type RWMathVec<T>::mathFunType2 takes a T
and returns an RWMathVec<T>::norm_type.
RWMathVec<norm_type> RWMathVec< T >::apply2 | ( | mathFunType2 | f | ) | const |
Returns the result of applying the passed function to every element in the vector. A function of type RWMathVec<T>::mathFunType takes and returns a T
; a function of type RWMathVec<T>::mathFunType2 takes a T
and returns an RWMathVec<T>::norm_type.
Returns an iterator that points to the first element in the vector.
|
inline |
Returns an iterator that points to the first element in the vector.
size_t RWMathVec< T >::binaryStoreSize | ( | ) | const |
Returns the number of bytes required to store the vector to an RWFile using member function saveOn(RWFile&).
|
inline |
Returns an iterator that points to the first element in the vector.
|
inline |
Returns an iterator that points to one element past the last element in the vector.
Returns a copy with distinct instance variables.
|
inline |
Returns an iterator that points to the first element in the vector.
|
inline |
Returns an iterator that points to one element past the first element in the vector.
|
inline |
Returns a pointer to the start of a vector's data. Should be used with care, as this accesses the vector's data directly. You are responsible for recognizing the length and the stride of the vector.
|
inline |
Returns a pointer to the start of a vector's data. Should be used with care, as this accesses the vector's data directly. You are responsible for recognizing the length and the stride of the vector.
void RWMathVec< T >::deepenShallowCopy | ( | ) |
When invoked for a vector, guarantees that there is only one reference to that object and that its data are in contiguous storage.
Returns an iterator that points to one element past the last element in the vector.
|
inline |
Returns an iterator that points to one element past the last element in the vector.
|
inline |
Returns the number of elements in the vector.
|
inline |
Implicit conversion operator to RWMathVec<promote_type> . The promote_type
is rw_numeric_traits<T>::promote_type.
Returns false
if self and the argument are equivalent. To be equivalent, they must have the same number of entries and each element in self must equal the corresponding element in the argument.
|
inline |
Subscripting operators for the vector, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK
before including the header file. All subscripting operators return a new view of the same data as the vector being subscripted. An object of type RWRange or RWToEnd, the global object RWAll, or a character string may be substituted for an RWSlice.
|
inline |
Subscripting operators for the vector, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK
before including the header file. All subscripting operators return a new view of the same data as the vector being subscripted. An object of type RWRange or RWToEnd, the global object RWAll, or a character string may be substituted for an RWSlice.
Subscripting operators for the vector, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK
before including the header file. All subscripting operators return a new view of the same data as the vector being subscripted. An object of type RWRange or RWToEnd, the global object RWAll, or a character string may be substituted for an RWSlice.
|
inline |
Subscripting operators for the vector, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK
before including the header file. All subscripting operators return a new view of the same data as the vector being subscripted. An object of type RWRange or RWToEnd, the global object RWAll, or a character string may be substituted for an RWSlice.
Assignment by multiplication operator for scalars. The expression implies
Assignment by multiplication operator for vectors. The vectors must have the same dimensions. The expression implies
Increments each element of self. The functions taking an integer parameter are invoked if the operator is used as a postfix operator.
|
inline |
Increments each element of self. The functions taking an integer parameter are invoked if the operator is used as a postfix operator.
Assignment by addition operator for scalars. The expression implies
Assignment by addition operator for vectors. The vectors must have the same dimensions. The expression implies
Decrements each element of self. The functions taking an integer parameter are invoked if the operator is used as a postfix operator.
|
inline |
Decrements each element of self. The functions taking an integer parameter are invoked if the operator is used as a postfix operator.
Assignment by subtraction operator for scalars. The expression implies
Assignment by subtraction operator for vectors. The vectors must have the same dimensions. The expression implies
Assignment by division operator for scalars. The expression implies
Assignment by division operator for vectors. The vectors must have the same dimensions. The expression implies
Assignment operator for vectors. The vectors must have the same dimensions. The expression implies
RWMathVec<T>& RWMathVec< T >::operator= | ( | const RWMathVecPick< T > & | v | ) |
Assignment operator for vectors. The vectors must have the same dimensions. The expression implies
Assignment operator for scalars. The expression implies
Returns true
if self and the argument are equivalent. To be equivalent, they must have the same number of entries and each element in self must equal the corresponding element in the argument.
|
inline |
|
inline |
RWMathVecPick<T> RWMathVec< T >::pick | ( | const RWIntVec & | v | ) |
Returns a vector pick
. The results can be used as an lvalue. You can think of the picked elements as representing a vector in the order specified by the vector of indices v. Before using this function, you must include the header file rw/math/mthvecpk.h
.
|
inline |
Returns an iterator that points to the last element in the vector.
|
inline |
Returns an iterator that points to the first element in the vector.
Makes self a view of v's data. The view currently associated with the vector is lost.
|
inline |
Returns an iterator that points to one element past the first element in the vector.
|
inline |
Returns an iterator that points to one element past the first element in the vector.
void RWMathVec< T >::reshape | ( | size_t | n | ) |
Changes the length of the vector to n elements. After reshaping, the contents of the vector are undefined; that is, they can be and probably will be garbage.
void RWMathVec< T >::resize | ( | size_t | n | ) |
Changes the size of the vector to n elements, adding 0s or truncating as necessary.
Restores self from a virtual stream or an RWFile. To use these functions with a user-defined type T, the corresponding operator>>
must be defined:
void RWMathVec< T >::restoreFrom | ( | RWvistream & | ) |
Restores self from a virtual stream or an RWFile. To use these functions with a user-defined type T, the corresponding operator>>
must be defined:
Stores self to a virtual stream, or in a binary format to an RWFile. To use these functions with a user-defined type T, the corresponding operator<<
must be defined:
void RWMathVec< T >::saveOn | ( | RWvostream & | ) | const |
Stores self to a virtual stream, or in a binary format to an RWFile. To use these functions with a user-defined type T, the corresponding operator<<
must be defined:
Returns a vector which views a slice of the data. The slice begins at element start and extends for n elements. The increment between successive elements in the slice is stride.
|
inline |
Returns the distance between successive elements of the vector. The stride can be computed using &v[i+1]-&v[i]
.
Returns the absolute values of each element.
Program Output:
Returns the absolute values of each element.
Returns the absolute values of each element.
Returns the absolute values of each element.
Returns the absolute values of each element.
double
. Therefore, if abs() is invoked for class RWMathVec<DComplex> , a vector of class RWMathVec<double> is returned. Returns arc cosines y such that . The yi(in radians) are in the range , for elements xi with absolute values .
Takes x as an argument and returns arc sines y such that . The yi (in radians) are in the range
Takes x and returns y of arc tangents (in radians), such that , where .
At least one of the arguments xi or yi must be nonzero.
|
related |
Takes two arguments and returns quadrant correct arc tangents z (in radians), such that . For each element i, the expression is mathematically equivalent to:
At least one of the arguments xi or yi must be nonzero.
Takes x as an argument and returns y such that yi corresponds to the next integer greater than or equal to xi. For example, if x = [ -1.3, 4.3, 7.9] then y = [ -1, 5, 8].
Takes complex x as an argument and returns the complex conjugates x*. For example, if xi = (2.3, 1.4), then xi* = (2.3, -1.4).
|
related |
Returns the complex-conjugate dot product of two vectors x and y:
The two vectors must have the same number of elements or an exception with value MATH_VNMATCH
occurs.
Takes x as an argument and returns y such that . The xi are in radians. For complex arguments, the complex cosine is returned.
Takes x as an argument and returns hyperbolic cosines y such that . For complex arguments, the complex hyperbolic cosine is returned.
Takes a vector x and returns a vector y of values corresponding to the cumulative sum of x:
Program output:
Takes a vector x as an argument and returns a vector y of element differences. The first element in y is set equal to the first element of x. An element y(i) where i is not 0
is set equal to .
For example, if x = [2, 4, 5, 8] then y = [2, 2, 1, 3].
Returns the vector dot product z of two vectors, x and y. The two vectors must have the same number of elements or an exception with value MATH_VNMATCH
occurs.
For example, if x = [ 0, 1, 2] and y = [ 1, 3, 2], then z = 0 + 3 + 4 = 7. For vectors of type complex, see also function conjDot().
Takes an argument x and returns y such that:
If class T
is complex, the complex exponential is returned.
|
related |
Given a complex sequence points long, it is a complex conjugate-even sequence if:
,
Note that for a sequence to be complex conjugate-even, the imaginary parts of and must be 0. Given the lower half of the sequence, that is, this function expands it out to the entire sequence .
|
related |
Given a complex sequence points long, it is a complex conjugate-odd sequence if:
.
Note that for a sequence to be complex conjugate-odd, the real parts of and must be 0. Given the lower half of the sequence, that is, this function expands it out to the entire sequence .
Given a real sequence points long, it is an even sequence if:
,
Given the lower half of an even sequence, that is, expandEven() expands it out to the entire sequence .
Given a real sequence points long, it is an odd sequence if:
.
Note that for a sequence to be odd, . Given the lower half of an odd sequence, that is, , expandOdd() expands it out to the entire sequence .
Takes x as an argument and returns y such that yi corresponds to the largest integer less than or equal to xi. For example, if x = [ 1.3, 4.4, -3.2], then y = [ 1, 4, -4].
|
related |
Computes the Frobenius norm, which is the square root of the sum of squares of its entries. For a vector, the formula is:
|
related |
Computes the Frobenius norm, which is the square root of the sum of squares of its entries. For a vector, the formula is:
Computes the Frobenius norm, which is the square root of the sum of squares of its entries. For a vector, the formula is:
Takes complex x as an argument and returns y containing the imaginary parts . With most versions of complex, the results can be used as an l-value:
|
related |
|
related |
The function l1Norm() is the sum of absolute values of its entries:
|
related |
The function l1Norm() is the sum of absolute values of its entries:
The function l1Norm() is the sum of absolute values of its entries:
|
related |
The function l2Norm() is the square root of the sum of the squares of its entries:
|
related |
The function l2Norm() is the square root of the sum of the squares of its entries:
The function l2Norm() is the square root of the sum of the squares of its entries:
|
related |
The function linfNorm() is the maximum of absolute values of its entries:
|
related |
The function linfNorm() is the maximum of absolute values of its entries:
The function linfNorm() is the maximum of absolute values of its entries:
Takes x as an argument and returns natural logarithms y such that . The arguments x i must not be 0. For complex arguments, the principal value of the complex natural logarithm is returned.
Takes x as an argument and returns base 10 logarithms y such that . The arguments x i must not be 0.
|
related |
Return the index of the maximum element of the vector. If instead you want the maximum value use function maxValue().
|
related |
Returns the value of the element with largest absolute value. Note that this is not a norm in the mathematical sense of the word.
|
related |
Returns the value of the element with largest absolute value. Note that this is not a norm in the mathematical sense of the word.
Returns the value of the element with largest absolute value. Note that this is not a norm in the mathematical sense of the word.
|
related |
Return the maximum value.
|
related |
Takes a RWMathVec an argument and returns <x>, the mean value, where:
For example, if x = [1, 4, 3, 4], then <x> = 3.
|
related |
Return the index of the minimum element of the vector. If instead you want the minimum value use function minValue().
|
related |
Return the minimum value.
Takes complex x as an argument and returns real y containing the norm:
Multiplication operator, applied element-by-element. For example, for vectors u, w
, and scaler s, the expression implies .
Multiplication operator, applied element-by-element. For example, for scaler s, and vectors v, and w
, the expression implies .
Unary plus operator, applied element-by-element. For example, for vectors u
, and v, the expression implies .
|
related |
Addition operator, applied element-by-element. For example, for vectors u, v, and w
, the expression implies .
Addition operator, applied element-by-element. For example, for vectors u, w
, and scaler s, the expression implies .
Addition operator, applied element-by-element. For example, for scaler s, and vectors v, and w
, the expression implies .
Unary minus operator, applied element-by-element. For example, for vectors u
, and v, the expression implies .
|
related |
Subtraction operator, applied element-by-element. For example, for vectors u, v, and w
, the expression implies .
Subraction operator, applied element-by-element. For example, for scaler s
, and vectors v, and w
, the expression implies .
Subtraction operator, applied element-by-element. For example, for vectors u, w
, and scaler s, the expression implies .
|
related |
Division operator, applied element-by-element. For example, for vectors u, v, and w
, the expression implies .
Division operator, applied element-by-element. For example, for scaler s, and vectors v, and w
, the expression implies .
Division operator, applied element-by-element. For example, for vectors u, w
, and scaler s, the expression implies .
|
related |
Outputs a vector v to std::ostream s beginning with a left bracket [ and terminating with a right bracket
]. The output numbers are separated by spaces. If
T
is a user-defined type, the following operator must be defined for RWvostream and/or RWFile:
operator<<(ostream&s,constT&t);
|
related |
Reads vector v from stream s. It reads a sequence of numbers separated by white space. If the sequence of numbers begins with a left bracket [, the operator reads to a matching right bracket
]. If no left bracket is present, it reads to end of file. The vector v is initialized to the correct length. If
T
is a user-defined type, the following operator must be defined for RWvistream and/or RWFile:
operator>>(ostream&s,constT&t);
|
related |
Returns the outer product of two vectors. The outer product of the vectors and is the matrix A whose ijth entry is xiyj: that is, the jth column of A is yjx.
|
related |
The function pow() takes two arguments: pow( x, y ).
Returns z such that:
If the number of elements in x does not match the number of elements in y, an exception with value RWMATH_MNMATCH
will occur.
|
related |
Takes a vector xi with n elements as an argument and returns the product of the elements of the vector. For example, if x = [1, 4, 3], then y = 12.
Takes a complex argument x and returns real y containing the real part . With most versions of complex, the results can be used as an l-value:
Takes a vector x as an argument and returns a vector y whose elements are in reversed order. For example, if x = [2, 5, 1, 6], then y = [6, 1, 5, 2]. The reversed vector y is actually a reversed slice of the original vector. Hence, the results of this function can be used as an lvalue.
Returns a complex vector v containing the complex Nth roots of unity, that is:
If rootsOfOne() is invoked with arguments N and nterms, only the the first nterms of the N roots are returned in a vector of type RWMathVec<DComplex> with nterms elements.
Returns a complex vector v containing the complex Nth roots of unity, that is:
If rootsOfOne() is invoked with argument N, the N roots are returned in a vector of type RWMathVec<DComplex> with N elements.
The function sin() takes x as an argument and returns y such that . The xi are in radians. For complex classes, the complex sine is returned.
The function sinh() takes x as an argument and returns y such that . For complex classes, the complex hyperbolic sine is returned.
|
related |
Returns the spectral variance of a Fourier transformed series. If v is a complex series containing the complex spectral estimates, the spectral variance S is given by:
Note that the first term, the mean, is excluded from the sum.
The square root function. Takes x as an argument and returns y such that . For complex classes, the principal value of the complex square root is returned.
|
related |
Returns the sum of the elements of the vector. For example, if x = [1, 4, 3, 4], then y = 12.
The function tan() takes argument x and returns y such that .
The function tanh() takes argument x and returns y such that .
Converts an RWMathVec<int> instance into a corresponding RWMathVec<signed char> instance. Note that this is a narrowing operation; high order bits are removed.
Converts an RWMathVec<double> instance into a corresponding RWMathVec<float> instance. Note that this is a narrowing operation; high order bits are removed.
Converts an RWMathVec<double> instance into a corresponding RWMathVec<int> instance. Note that truncation occurs.
Converts an RWMathVec<float> instance into a corresponding RWMathVec<int> instance. Note that truncation occurs.
|
related |
Takes a vector x as an argument and returns its variance y as in:
where <x> is the mean of the vector and N is the length of the vector. Note that this is the biased variance.
Takes a vector x as an argument and returns its variance y as in:
where <x> is the mean of the vector and N is the length of the vector. Note that this is the biased variance.
|
related |
Takes a vector x as an argument and returns its variance y as in:
where <x> is the mean of the vector and N is the length of the vector. Note that this is the biased variance.
Copyright © 2014 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.