SourcePro® API Reference Guide

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

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

#include <rw/math/genmat.h>

Public Member Functions

 RWConvertGenMat (const RWGenMat< From > &v)
 
 operator RWGenMat< To > () const
 

Detailed Description

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

Class RWConvertGenMat converts between RWGenMat types with different datatypes. It assumes that there is a conversion operator from From to To.

Synopsis
template <class From, class To>
Converts between RWGenMat types with different datatypes.
Definition genmat.h:2551
Example
#include <rw/math/genmat.h>
int main() {
// create a 2x2 matrix
RWGenMat<int> d("2x2[1 2 3 4]");
// convert int matrix d to DComplex
// matrix c with imag part 0
// convert int matrix d to a double
// matrix and then call sin
s = sin(s);
}
A templatized general matrix class.
Definition genmat.h:741
RWConvertGenMat(const RWGenMat< From > &v)
Definition genmat.h:2558

Constructor & Destructor Documentation

◆ RWConvertGenMat()

template<class From , class To >
RWConvertGenMat< From, To >::RWConvertGenMat ( const RWGenMat< From > & v)
inline

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

Member Function Documentation

◆ operator RWGenMat< To >()

template<class From , class To >
RWConvertGenMat< From, To >::operator RWGenMat< To > ( ) const
inline

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

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