Imagine++
Public Member Functions | List of all members
Imagine::Coords< dim > Class Template Reference

Coordinates. More...

#include "Imagine/Common.h"

Inheritance diagram for Imagine::Coords< dim >:
Imagine::FVector< int, dim > Imagine::FArray< int, dim >

Public Member Functions

 Coords ()
 Empty constructor. More...
 
 Coords (const Base &v)
 Copy constructor Constructs from anit Coords. More...
 
 Coords (const int v[dim])
 Constructor from C array. More...
 
 Coords (int v)
 Constructor with constant value. More...
 
 Coords (int x, int y)
 2D alias. More...
 
 Coords (int x, int y, int z)
 3D alias. More...
 
size_t prod () const
 Product of coordinates. More...
 
- Public Member Functions inherited from Imagine::FVector< int, dim >
 FVector ()
 Empty constructor. More...
 
 FVector (const int &v)
 Constructor with constant value. More...
 
 FVector (const T2 t[dim])
 Constructor from C array. More...
 
 FVector (const FArray< T2, dim > &a)
 Copy constructor. More...
 
 FVector (int x, int y)
 2D alias. More...
 
 FVector (int x, int y, int z)
 3D alias. More...
 
FVectorfill (const int &v)
 Filling. More...
 
FVectornormalize ()
 Euclidean in-place normalization. More...
 
int operator* (const FVector &v) const
 Scalar product. More...
 
FVector operator* (int s) const
 Scalar multiplication. More...
 
FVectoroperator*= (int s)
 Scalar in place multiplication. More...
 
FVector operator+ (const FVector &v) const
 Addition. More...
 
FVector operator+ (int s) const
 Scalar Addition. More...
 
FVectoroperator+= (const FVector &v)
 In place Addition. More...
 
FVectoroperator+= (int s)
 Scalar in place Addition. More...
 
FVector operator- (const FVector &v) const
 Substraction. More...
 
FVector operator- (int s) const
 Scalar Substraction. More...
 
FVector operator- () const
 Opposite. More...
 
FVectoroperator-= (const FVector &v)
 In place Substraction. More...
 
FVectoroperator-= (int s)
 Scalar in place substractrion. More...
 
FVector operator/ (int s) const
 Scalar division. More...
 
FVectoroperator/= (int s)
 Scalar in place division. More...
 
FVectoroperator= (const FArray< T2, dim > &b)
 Assignment. More...
 
int operator^ (const FVector< int, 2 > &v) const
 2D cross product. More...
 
FVector< int, 3 > operator^ (const FVector< int, 3 > &v) const
 3D cross product. More...
 
const int & x () const
 Read alias. More...
 
int & x ()
 Write alias. More...
 
const int & y () const
 Read alias. More...
 
int & y ()
 Write alias. More...
 
const int & z () const
 Read alias. More...
 
int & z ()
 Write alias. More...
 
- Public Member Functions inherited from Imagine::FArray< int, dim >
 FArray ()
 Empty constructor. More...
 
 FArray (const int &v)
 Constructor with constant value. More...
 
 FArray (const T2 t[S])
 Constructor from C array. More...
 
 FArray (const FArray< T2, S > &a)
 Copy constructor. More...
 
 FArray (int v0, int v1)
 2D alias. More...
 
 FArray (int v0, int v1, int v2)
 3D alias. More...
 
 FArray (int v0, int v1, int v2, int v3)
 4D alias. More...
 
iterator begin ()
 Begin iterator. More...
 
const_iterator begin () const
 Begin const iterator. More...
 
FArraycopy (const T2 t[S])
 C array of different type copy. More...
 
FArraycopy (const FArray< T2, S > &b)
 Copy. More...
 
const int * data () const
 Data pointer (read). More...
 
int * data ()
 Data pointer (write). More...
 
bool empty () const
 Is empty. More...
 
iterator end ()
 End iterator. More...
 
const_iterator end () const
 End const iterator. More...
 
FArrayfill (const int &v)
 Filling. More...
 
bool operator!= (const FArray &b) const
 Inequality test. More...
 
FArrayoperator= (const FArray< T2, S > &b)
 Assignment. More...
 
bool operator== (const FArray &b) const
 Equality test. More...
 
const int & operator[] (int i) const
 Read access. More...
 
int & operator[] (int i)
 Write access. More...
 
int size () const
 Size. More...
 

Additional Inherited Members

- Public Types inherited from Imagine::FArray< int, dim >
typedef const int * const_iterator
 Const iterator type.
 
typedef int * iterator
 Iterator type.
 
- Static Public Member Functions inherited from Imagine::FVector< int, dim >
static FVector Zero ()
 Zero vector Vector with constant 0 value. More...
 
- Protected Attributes inherited from Imagine::FArray< int, dim >
int _data [S]
 internal storage.
 

Detailed Description

template<int dim>
class Imagine::Coords< dim >

Coordinates used by MultiArray

Parameters
dimdimension
Examples:
Common/test/test.cpp, and Images/test/test.cpp.

Constructor & Destructor Documentation

◆ Coords() [1/6]

template<int dim>
Imagine::Coords< dim >::Coords ( )
inline

Constructs an uninitialized Coords

Coords<3> a; // uninitialized

◆ Coords() [2/6]

template<int dim>
Imagine::Coords< dim >::Coords ( const Base v)
inline
Parameters
vCoords to be copied
Coords<3> d(c); // copy constructor

◆ Coords() [3/6]

template<int dim>
Imagine::Coords< dim >::Coords ( const int  v[dim])
inline

Constructs a Coords and copies values to it

Parameters
vC array used for initialization
int t[]={1,2,3}; // filled from C array
Coords<3> c(t); // (copying array into fresh memory)

◆ Coords() [4/6]

template<int dim>
Imagine::Coords< dim >::Coords ( int  v)
inline

Constructs a Coords and sets each coordinate to v

Parameters
vvalue used for initialization
Coords<3> b(1); // filled with constant value

◆ Coords() [5/6]

template<int dim>
Imagine::Coords< dim >::Coords ( int  x,
int  y 
)
inline

Short constructor for 2D Coords

Parameters
xvalue for index 0 coordinate
yvalue for index 1 coordinate
Coords<2> e(1,2); // alias for 2D case

◆ Coords() [6/6]

template<int dim>
Imagine::Coords< dim >::Coords ( int  x,
int  y,
int  z 
)
inline

Short constructor for 3D Coords

Parameters
xvalue for index 0 coordinate
yvalue for index 1 coordinate
zvalue for index 2 coordinate
Coords<3> f(1,2,3); // alias for 3D case

Member Function Documentation

◆ prod()

template<int dim>
size_t Imagine::Coords< dim >::prod ( ) const
inline

Product of coordinates (note: result is of type size_t)

Returns
Result
/*size_t p=*/f.prod(); // product of coordinates


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