Stan Math Library  4.9.0 Automatic Differentiation
Searching...
No Matches
std::complex< stan::math::fvar< T > > Class Template Reference

## Detailed Description

template<typename T>
class std::complex< stan::math::fvar< T > >

Specialization of the standard library complex number type for reverse-mode autodiff type stan::math::fvar<T>.

Template Parameters
 T forward-mode autodiff value type

Definition at line 18 of file std_complex.hpp.

#include <std_complex.hpp>

Inheritance diagram for std::complex< stan::math::fvar< T > >:

## Public Types

using base_t = stan::math::complex_base< stan::math::fvar< T > >

using value_type = stan::math::fvar< T >
Type of real and imaginary parts.

using complex_type = std::complex< value_type >
Derived complex type used for function return types.

## Public Member Functions

complex ()=default
Construct a complex number with zero real and imaginary parts.

template<typename U , typename = stan::require_stan_scalar_t<U>>
complex (const U &re)
Construct a complex number with the specified real part and a zero imaginary part.

template<typename U >
complex (const std::complex< U > &z)

template<typename U , typename V >
complex (const U &re, const V &im)
Construct a complex number from the specified real and imaginary parts.

template<typename U , typename = stan::require_arithmetic_t<U>>
auto & operator= (const std::complex< U > &x)
Set the real and imaginary parts to those of the specified complex number.

value_type real () const
Return the real part.

void real (const value_type &re)
Set the real part to the specified value.

value_type imag () const
Return the imaginary part.

void imag (const value_type &im)
Set the imaginary part to the specified value.

complex_typeoperator+= (const U &x)
Add specified real value to real part.

complex_typeoperator+= (const std::complex< U > &other)
Adds specified complex number to this.

complex_typeoperator-= (const U &x)
Subtracts specified real number from real part.

complex_typeoperator-= (const std::complex< U > &other)
Subtracts specified complex number from this.

complex_typeoperator*= (const U &x)
Multiplies this by the specified real number.

complex_typeoperator*= (const std::complex< U > &other)
Multiplies this by specified complex number.

complex_typeoperator/= (const U &x)
Divides this by the specified real number.

complex_typeoperator/= (const std::complex< U > &other)
Divides this by the specified complex number.

## Protected Member Functions

complex_typederived ()
Return this complex base cast to the complex type.

## Protected Attributes

value_type re_
Real part.

value_type im_
Imaginary part.

The documentation for this class was generated from the following file: