SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWConvertMathVec< From, To > Struct Template Reference

Converts between RWMathVec types with different datatypes. More...

#include <rw/math/mathvec.h>

Public Member Functions

 RWConvertMathVec (const RWMathVec< From > &v)
 
 operator RWMathVec< To > ()
 

Detailed Description

template<class From, class To>
struct RWConvertMathVec< From, To >

Class RWConvertMathVec converts between RWMathVec types with different datatypes.

Synopsis
template <class From, class To>
Converts between RWMathVec types with different datatypes.
Definition mathvec.h:1368
Example
#include <rw/math/mathvec.h>
int main() {
// create a length 5 vector of 1's
RWMathVec<int> d(5, 1);
// convert int vector d to a DComplex
// vector c with all real parts 1
// convert int vector d to a double vector
//and then call sin
s = sin(s);
}
A templatized vector class.
Definition mathvec.h:667
RWConvertMathVec(const RWMathVec< From > &v)
Definition mathvec.h:1375

Constructor & Destructor Documentation

◆ RWConvertMathVec()

template<class From , class To >
RWConvertMathVec< From, To >::RWConvertMathVec ( const RWMathVec< From > & v)
inline

Constructs a new vector of type RWMathVec that can be used anywhere as a type RWMathVec. Note that a temporary array is created every time this constructor is invoked, but the conversion operator below can be used repeatedly without creating additional temporaries.

Member Function Documentation

◆ operator RWMathVec< To >()

template<class From , class To >
RWConvertMathVec< From, To >::operator RWMathVec< To > ( )
inline

Automatic conversion operator that enables class RWConvertMathVec to be used as an RWMathVec. While the actual conversion takes place in the constructor, this operator provides a reference to that converted vector.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.