HILA
Loading...
Searching...
No Matches
array.h File Reference

Definition of Array class. More...

#include "datatypes/matrix.h"
Include dependency graph for array.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Array< n, m, T >
 \( n\times m \) Array type More...
 

Namespaces

namespace  hila
 Invert diagonal + const. matrix using Sherman-Morrison formula.
 

Typedefs

template<int n, typename T = double>
using Array1d = Array< n, 1, T >
 Array1d is alias to Array where m = 1.
 
template<int n, int m, typename T = double>
using Array2d = Array< n, m, T >
 Array2d is simply alias of Array.
 

Functions

template<const int n, const int m, typename T >
Array< n, m, T > conj (const Array< n, m, T > &arg)
 Return conjugate Array.
 
template<const int n, const int m, typename T >
Array< n, m, hila::arithmetic_type< T > > imag (const Array< n, m, T > &arg)
 Return imaginary part of Array.
 
template<int n, int m, typename T >
std::ostream & operator<< (std::ostream &strm, const Array< n, m, T > &A)
 Stream operator.
 
template<const int n, const int m, typename T >
Array< n, m, hila::arithmetic_type< T > > real (const Array< n, m, T > &arg)
 Return real part of Array.
 
template<int n, int m, typename T >
hila::arithmetic_type< T > squarenorm (const Array< n, m, T > &rhs)
 Return square norm of Array.
 
template<int n, int m, typename T >
std::string hila::to_string (const Array< n, m, T > &A, int prec=8, char separator=' ')
 Converts Array object to string.
 

Detailed Description

Definition of Array class.

This file contains the definitions of Array class and utility functions related to it.

Definition in file array.h.

Function Documentation

◆ conj()

template<const int n, const int m, typename T >
Array< n, m, T > conj ( const Array< n, m, T > &  arg)
inline

Return conjugate Array.

Wrapper around Array::conj

Template Parameters
nNumber of rows
mNumber of columns
TArray element type
Parameters
argArray to be conjugated
Returns
Array<n, m, T>

Definition at line 648 of file array.h.

◆ imag()

template<const int n, const int m, typename T >
Array< n, m, hila::arithmetic_type< T > > imag ( const Array< n, m, T > &  arg)
inline

Return imaginary part of Array.

Wrapper around Array::imag

Template Parameters
nNumber of rows
mNumber of columns
TArray element type
Parameters
argArray to return real part of
Returns
Array<n, m, T>

Definition at line 676 of file array.h.

◆ operator<<()

template<int n, int m, typename T >
std::ostream & operator<< ( std::ostream &  strm,
const Array< n, m, T > &  A 
)

Stream operator.

Naive Stream operator for formatting Matrix for printing. Simply puts elements one after the other in row major order

Template Parameters
nNumber of rows
mNumber of columns
TArray element type
Parameters
strmOS stream
AArray to write
Returns
std::ostream&

Definition at line 916 of file array.h.

◆ real()

template<const int n, const int m, typename T >
Array< n, m, hila::arithmetic_type< T > > real ( const Array< n, m, T > &  arg)
inline

Return real part of Array.

Wrapper around Array::real

Template Parameters
nNumber of rows
mNumber of columns
TArray element type
Parameters
argArray to return real part of
Returns
Array<n, m, T>

Definition at line 662 of file array.h.

◆ squarenorm()

template<int n, int m, typename T >
hila::arithmetic_type< T > squarenorm ( const Array< n, m, T > &  rhs)
inline

Return square norm of Array.

Wrapper around Array::squarenrom

Template Parameters
nNumber of rows
mNumber of columns
TArray element type
Parameters
rhsArray to compute squarenorm of
Returns
hila::arithmetic_type<T>

Definition at line 957 of file array.h.